mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 11:01:37 -05:00
Compare commits
310 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
16801c522d | ||
|
|
e9389a5069 | ||
|
|
0e4204752a | ||
|
|
f579d1bb8d | ||
|
|
b35241dbe6 | ||
|
|
588b9a1fcf | ||
|
|
0c870ed4e6 | ||
|
|
3d6929e78f | ||
|
|
fd08943244 | ||
|
|
8c99e22fb4 | ||
|
|
86fbc4002a | ||
|
|
2f57356ae8 | ||
|
|
eca946a885 | ||
|
|
601bd4bd03 | ||
|
|
87b064aa7e | ||
|
|
d87eebd6a5 | ||
|
|
9c14910c55 | ||
|
|
61e3700ed4 | ||
|
|
09f017c6f4 | ||
|
|
b01218cbbc | ||
|
|
f984e89493 | ||
|
|
479fac2310 | ||
|
|
32ea281e11 | ||
|
|
29031462c7 | ||
|
|
7379d66729 | ||
|
|
705a7d7dc6 | ||
|
|
9764438982 | ||
|
|
a93f5883b9 | ||
|
|
5578693635 | ||
|
|
9cc31bee62 | ||
|
|
6f17f0de58 | ||
|
|
20f7670b32 | ||
|
|
f3a255a7f7 | ||
|
|
e1a0835140 | ||
|
|
cfcee3287a | ||
|
|
0a9a0d3f46 | ||
|
|
34a7340a18 | ||
|
|
95f0ae32db | ||
|
|
2b427d8a62 | ||
|
|
c6447d3280 | ||
|
|
d363bfb0da | ||
|
|
2ac6852cf1 | ||
|
|
8f15c05d8a | ||
|
|
76cf10d23c | ||
|
|
673e5a85cb | ||
|
|
997e91f19c | ||
|
|
a93cc68e24 | ||
|
|
eb1218b651 | ||
|
|
df5a8dcb6a | ||
|
|
837404b2d6 | ||
|
|
9f62e2bf22 | ||
|
|
299568a506 | ||
|
|
47c77cc2a7 | ||
|
|
0f9d98730e | ||
|
|
ff0992510b | ||
|
|
9293d3654c | ||
|
|
886329cd67 | ||
|
|
00d0e4778b | ||
|
|
89786bea04 | ||
|
|
efab499f1f | ||
|
|
b5b65117a7 | ||
|
|
c1f6a67829 | ||
|
|
01db78f743 | ||
|
|
6383bc7ebd | ||
|
|
4c3d51aa52 | ||
|
|
5d13ebf0d2 | ||
|
|
70851716f7 | ||
|
|
c8bcd25832 | ||
|
|
2de3bd3209 | ||
|
|
1c9841c8e6 | ||
|
|
2448a109fc | ||
|
|
c05ff67622 | ||
|
|
d6b5d3c6b1 | ||
|
|
80baa4a732 | ||
|
|
2ae3810dac | ||
|
|
7d7a7e2e37 | ||
|
|
29cf1f898e | ||
|
|
924815353d | ||
|
|
6cf82d2611 | ||
|
|
73d9b7f22a | ||
|
|
412214e193 | ||
|
|
ff207859d6 | ||
|
|
067fcc8dfb | ||
|
|
d2892ff78b | ||
|
|
a9056bbba5 | ||
|
|
70352f94ea | ||
|
|
b1d58767c4 | ||
|
|
4a9c47d3d6 | ||
|
|
628fd8d74d | ||
|
|
d7ea1123ef | ||
|
|
eeae87ea32 | ||
|
|
1a639f83c4 | ||
|
|
933cfb21ef | ||
|
|
5982925ed7 | ||
|
|
9090143f9d | ||
|
|
10b681b3c8 | ||
|
|
de5f1eb780 | ||
|
|
c446cea3a0 | ||
|
|
41a90c01c3 | ||
|
|
1b78a9b1e0 | ||
|
|
c74bac3746 | ||
|
|
4c54b5dbac | ||
|
|
8fe0a13b61 | ||
|
|
2fc0e28e57 | ||
|
|
c6bc68f399 | ||
|
|
0cec223301 | ||
|
|
ab6fb810f8 | ||
|
|
7eef23f232 | ||
|
|
1d0f76d26a | ||
|
|
cec7753e3d | ||
|
|
161ea001c0 | ||
|
|
f2ffa6c7e5 | ||
|
|
5194ee2f9b | ||
|
|
1e308639e5 | ||
|
|
98584d32a7 | ||
|
|
5672500af2 | ||
|
|
d69cda80c3 | ||
|
|
47e716d3b2 | ||
|
|
6bd3ed72dd | ||
|
|
48c3702c7a | ||
|
|
506c6a5e5f | ||
|
|
873c6a39fe | ||
|
|
74b89a0a85 | ||
|
|
6b0332b2d1 | ||
|
|
2d70ff7f4e | ||
|
|
dd5c0ce08f | ||
|
|
71375808b9 | ||
|
|
0c56d44e4f | ||
|
|
321b41b7e1 | ||
|
|
2503b18d4b | ||
|
|
bbf6fcb0fc | ||
|
|
6e5b13ac8f | ||
|
|
30c8182f16 | ||
|
|
f10a504f45 | ||
|
|
844bf04c42 | ||
|
|
17bb895f7c | ||
|
|
e257612e82 | ||
|
|
3d8ed48bee | ||
|
|
73ea8b79b2 | ||
|
|
9af1f3b0eb | ||
|
|
fa3eaa59f5 | ||
|
|
fcec5f2b59 | ||
|
|
92fa296533 | ||
|
|
085752f111 | ||
|
|
0f934081e1 | ||
|
|
3a8b74a311 | ||
|
|
45341d786b | ||
|
|
eac05c85f1 | ||
|
|
c11c7d2f0e | ||
|
|
ac6a27b9c2 | ||
|
|
5d81d70a9a | ||
|
|
68061de010 | ||
|
|
2af13c18d2 | ||
|
|
8c61538a27 | ||
|
|
1a2381cc7c | ||
|
|
5283a7c874 | ||
|
|
ec0a7a29d3 | ||
|
|
aa22466c0f | ||
|
|
fe9ffddd3b | ||
|
|
39ac8498dc | ||
|
|
b4e30e17af | ||
|
|
32ac169906 | ||
|
|
df3f1768f7 | ||
|
|
343daf58fe | ||
|
|
8e67b104c3 | ||
|
|
4b2121e3f8 | ||
|
|
10d817b6b4 | ||
|
|
2208666eef | ||
|
|
9c7f844d59 | ||
|
|
86ad477c77 | ||
|
|
62df5359e2 | ||
|
|
5a2bbc0375 | ||
|
|
2cce8b21c8 | ||
|
|
56a6f70c0d | ||
|
|
c6689700f6 | ||
|
|
5b2c14f11a | ||
|
|
402d693885 | ||
|
|
7d751a20ab | ||
|
|
261e6fa89e | ||
|
|
637a33c7a7 | ||
|
|
56695be14a | ||
|
|
ddfdd43fc3 | ||
|
|
648287fa85 | ||
|
|
de27f2c2a5 | ||
|
|
8ff0ee59c5 | ||
|
|
a5a8c9761e | ||
|
|
89554e5c14 | ||
|
|
5618799305 | ||
|
|
32a89676f1 | ||
|
|
461dd79bc2 | ||
|
|
7ef3f003dd | ||
|
|
0c1edc1aeb | ||
|
|
2dfd75352f | ||
|
|
136a1d8cee | ||
|
|
5fd29d5ad8 | ||
|
|
64929de09d | ||
|
|
fefe1454de | ||
|
|
0eaee18dc4 | ||
|
|
28fff9ace8 | ||
|
|
a41073adbf | ||
|
|
379eae22ed | ||
|
|
f49fe59e1f | ||
|
|
9e61c468d1 | ||
|
|
7e0c7e35a1 | ||
|
|
b02bf17d1f | ||
|
|
510b84df3c | ||
|
|
2eebcab74a | ||
|
|
5ccc0fd97b | ||
|
|
76967d9467 | ||
|
|
eb0ee387ec | ||
|
|
bd7aac8ee0 | ||
|
|
977111eb21 | ||
|
|
5ccde42213 | ||
|
|
8b9aeb8679 | ||
|
|
308dfee963 | ||
|
|
f22dacadbe | ||
|
|
13d4ab22b1 | ||
|
|
968d570073 | ||
|
|
638eb151dd | ||
|
|
52e3c2f9c7 | ||
|
|
d517cf0c8c | ||
|
|
9acd757f6a | ||
|
|
167a9f991a | ||
|
|
5cebfb3013 | ||
|
|
4e5d001a9c | ||
|
|
09b578a169 | ||
|
|
d3105beb43 | ||
|
|
74c2d16660 | ||
|
|
c09e7b9e2f | ||
|
|
88126c68e7 | ||
|
|
455de9add6 | ||
|
|
2f6c944317 | ||
|
|
0059ffb777 | ||
|
|
12ba85ec33 | ||
|
|
c161f8d8ad | ||
|
|
206738db63 | ||
|
|
7ecb6b4427 | ||
|
|
0c47a4486b | ||
|
|
c79929fdd2 | ||
|
|
61cbc5eff0 | ||
|
|
fa4ad6cdb9 | ||
|
|
1b26dc0558 | ||
|
|
833313c72b | ||
|
|
8a0824c1c6 | ||
|
|
2d2376a2a6 | ||
|
|
774151b6e9 | ||
|
|
041f34beda | ||
|
|
b1526603cc | ||
|
|
6070922579 | ||
|
|
8cdb5b36a9 | ||
|
|
ad68fddbc9 | ||
|
|
dd8b12f805 | ||
|
|
c5d3251bb5 | ||
|
|
48b6dd796b | ||
|
|
362af3c153 | ||
|
|
fa2fcf2e40 | ||
|
|
8529b52e73 | ||
|
|
ef5ca7bc3a | ||
|
|
5b34dd2eee | ||
|
|
d647dbde09 | ||
|
|
d2e367c139 | ||
|
|
c3ddbba997 | ||
|
|
51ab435e5f | ||
|
|
4a8609c3ef | ||
|
|
03df1edcf8 | ||
|
|
5bd983e7a3 | ||
|
|
4293d53e79 | ||
|
|
ce10c3ac3f | ||
|
|
74caccdfe6 | ||
|
|
778a34a9d2 | ||
|
|
102d820935 | ||
|
|
4a4e6dd90c | ||
|
|
82a08d108b | ||
|
|
099916bf19 | ||
|
|
48dcb7258e | ||
|
|
e181cf2fcd | ||
|
|
746b4d7815 | ||
|
|
a67e3abb4c | ||
|
|
30d9e9c141 | ||
|
|
0fd870d156 | ||
|
|
768d333b35 | ||
|
|
2058682743 | ||
|
|
1c0f7c6702 | ||
|
|
9e0ba700c1 | ||
|
|
ea5f9be441 | ||
|
|
6b5c31410d | ||
|
|
8e4d0ad446 | ||
|
|
0a6dc2720d | ||
|
|
ef8c0e91e6 | ||
|
|
2f6c764869 | ||
|
|
73b9849dd5 | ||
|
|
64e217eac2 | ||
|
|
826e069b63 | ||
|
|
6e8a08c27a | ||
|
|
5a01218691 | ||
|
|
f45374bc30 | ||
|
|
ecbd8fb82c | ||
|
|
a42407b81a | ||
|
|
a622e4ac40 | ||
|
|
6816f2dabb | ||
|
|
a0c3f8f614 | ||
|
|
01b9754c80 | ||
|
|
cd8f26ae9d | ||
|
|
b650168704 | ||
|
|
9587edd867 | ||
|
|
642920504a | ||
|
|
67abc2f690 | ||
|
|
5bf85a2855 | ||
|
|
829717f5de | ||
|
|
866bfc61ba |
9
.config/CredScanSuppressions.json
Normal file
9
.config/CredScanSuppressions.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"tool": "Credential Scanner",
|
||||
"suppressions": [
|
||||
{
|
||||
"file": "src\\vs\\base\\test\\common\\uri.test.ts",
|
||||
"_justification": "External code"
|
||||
}
|
||||
]
|
||||
}
|
||||
16
.eslintignore
Normal file
16
.eslintignore
Normal file
@@ -0,0 +1,16 @@
|
||||
**/vs/nls.build.js
|
||||
**/vs/nls.js
|
||||
**/vs/css.build.js
|
||||
**/vs/css.js
|
||||
**/vs/loader.js
|
||||
**/promise-polyfill/**
|
||||
**/insane/**
|
||||
**/marked/**
|
||||
**/test/**/*.js
|
||||
**/node_modules/**
|
||||
**/vscode-api-tests/testWorkspace/**
|
||||
**/vscode-api-tests/testWorkspace2/**
|
||||
**/extensions/**/out/**
|
||||
**/extensions/**/build/**
|
||||
**/extensions/markdown-language-features/media/**
|
||||
**/extensions/typescript-basics/test/colorize-fixtures/**
|
||||
768
.eslintrc.json
768
.eslintrc.json
@@ -1,20 +1,752 @@
|
||||
{
|
||||
"root": true,
|
||||
"env": {
|
||||
"node": true,
|
||||
"es6": true
|
||||
},
|
||||
"rules": {
|
||||
"no-console": 0,
|
||||
"no-cond-assign": 0,
|
||||
"no-unused-vars": 1,
|
||||
"no-extra-semi": "warn",
|
||||
"semi": "warn"
|
||||
},
|
||||
"extends": "eslint:recommended",
|
||||
"parserOptions": {
|
||||
"ecmaFeatures": {
|
||||
"experimentalObjectRestSpread": true
|
||||
}
|
||||
}
|
||||
"root": true,
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 6,
|
||||
"sourceType": "module"
|
||||
},
|
||||
"plugins": [
|
||||
"@typescript-eslint",
|
||||
"jsdoc"
|
||||
],
|
||||
"rules": {
|
||||
"constructor-super": "warn",
|
||||
"curly": "warn",
|
||||
"eqeqeq": "warn",
|
||||
"no-buffer-constructor": "warn",
|
||||
"no-caller": "warn",
|
||||
"no-debugger": "warn",
|
||||
"no-duplicate-case": "warn",
|
||||
"no-duplicate-imports": "warn",
|
||||
"no-eval": "warn",
|
||||
"no-extra-semi": "warn",
|
||||
"no-new-wrappers": "warn",
|
||||
"no-redeclare": "off",
|
||||
"no-sparse-arrays": "warn",
|
||||
"no-throw-literal": "warn",
|
||||
"no-unsafe-finally": "warn",
|
||||
"no-unused-labels": "warn",
|
||||
"no-restricted-globals": [
|
||||
"warn",
|
||||
"name",
|
||||
"length",
|
||||
"event",
|
||||
"closed",
|
||||
"external",
|
||||
"status",
|
||||
"origin",
|
||||
"orientation"
|
||||
], // non-complete list of globals that are easy to access unintentionally
|
||||
"no-var": "warn",
|
||||
"jsdoc/no-types": "warn",
|
||||
"semi": "off",
|
||||
"@typescript-eslint/semi": "warn",
|
||||
"@typescript-eslint/class-name-casing": "warn",
|
||||
"code-no-unused-expressions": [
|
||||
"warn",
|
||||
{
|
||||
"allowTernary": true
|
||||
}
|
||||
],
|
||||
"code-translation-remind": "warn",
|
||||
"code-no-nls-in-standalone-editor": "warn",
|
||||
"code-no-standalone-editor": "warn",
|
||||
"code-no-unexternalized-strings": "warn",
|
||||
"code-layering": [
|
||||
"warn",
|
||||
{
|
||||
"common": [],
|
||||
"node": [
|
||||
"common"
|
||||
],
|
||||
"browser": [
|
||||
"common"
|
||||
],
|
||||
"electron-main": [
|
||||
"common",
|
||||
"node"
|
||||
],
|
||||
"electron-browser": [
|
||||
"common",
|
||||
"browser",
|
||||
"node"
|
||||
]
|
||||
}
|
||||
],
|
||||
"code-import-patterns": [
|
||||
"warn",
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
// !!! Do not relax these rules !!!
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
{
|
||||
"target": "**/{vs,sql}/base/common/**",
|
||||
"restrictions": [
|
||||
"vs/nls",
|
||||
"**/{vs,sql}/base/common/**"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{vs,sql}/base/test/common/**",
|
||||
"restrictions": [
|
||||
"assert",
|
||||
"sinon",
|
||||
"vs/nls",
|
||||
"**/{vs,sql}/base/common/**",
|
||||
"**/{vs,sql}/base/test/common/**"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{vs,sql}/base/browser/**",
|
||||
"restrictions": [
|
||||
"vs/nls",
|
||||
"vs/css!./**/*",
|
||||
"**/{vs,sql}/base/{common,browser}/**",
|
||||
"@angular/*",
|
||||
"rxjs/*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{vs,sql}/base/node/**",
|
||||
"restrictions": [
|
||||
"vs/nls",
|
||||
"**/{vs,sql}/base/{common,node}/**",
|
||||
"!path" // node modules (except path where we have our own impl)
|
||||
]
|
||||
},
|
||||
{
|
||||
// vs/base/test/browser contains tests for vs/base/browser
|
||||
"target": "**/{vs,sql}/base/test/browser/**",
|
||||
"restrictions": [
|
||||
"assert",
|
||||
"sinon",
|
||||
"vs/nls",
|
||||
"**/{vs,sql}/base/{common,browser}/**",
|
||||
"**/{vs,sql}/base/test/{common,browser}/**",
|
||||
"@angular/*",
|
||||
"rxjs/*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{vs,sql}/base/parts/*/common/**",
|
||||
"restrictions": [
|
||||
"vs/nls",
|
||||
"**/{vs,sql}/base/common/**",
|
||||
"**/{vs,sql}/base/parts/*/common/**"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{vs,sql}/base/parts/*/browser/**",
|
||||
"restrictions": [
|
||||
"vs/nls",
|
||||
"vs/css!./**/*",
|
||||
"**/{vs,sql}/base/{common,browser}/**",
|
||||
"**/{vs,sql}/base/parts/*/{common,browser}/**",
|
||||
"@angular/*",
|
||||
"rxjs/*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{vs,sql}/base/parts/*/node/**",
|
||||
"restrictions": [
|
||||
"vs/nls",
|
||||
"**/{vs,sql}/base/{common,node}/**",
|
||||
"**/{vs,sql}/base/parts/*/{common,node}/**",
|
||||
"!path" // node modules (except path where we have our own impl)
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{vs,sql}/base/parts/*/electron-browser/**",
|
||||
"restrictions": [
|
||||
"vs/nls",
|
||||
"vs/css!./**/*",
|
||||
"**/{vs,sql}/base/{common,browser,node,electron-browser}/**",
|
||||
"**/{vs,sql}/base/parts/*/{common,browser,node,electron-browser}/**",
|
||||
"!path", // node modules (except path where we have our own impl)
|
||||
"@angular/*",
|
||||
"rxjs/*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{vs,sql}/base/parts/*/electron-main/**",
|
||||
"restrictions": [
|
||||
"vs/nls",
|
||||
"**/{vs,sql}/base/{common,node,electron-main}/**",
|
||||
"**/{vs,sql}/base/parts/*/{common,node,electron-main}/**",
|
||||
"!path", // node modules (except path where we have our own impl)
|
||||
"@angular/*",
|
||||
"rxjs/*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{vs,sql}/platform/*/common/**",
|
||||
"restrictions": [
|
||||
"vs/nls",
|
||||
"azdata",
|
||||
"**/{vs,sql}/base/common/**",
|
||||
"**/{vs,sql}/base/parts/*/common/**",
|
||||
"**/{vs,sql}/platform/*/common/**"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{vs,sql}/platform/*/test/common/**",
|
||||
"restrictions": [
|
||||
"assert",
|
||||
"typemoq",
|
||||
"sinon",
|
||||
"vs/nls",
|
||||
"azdata",
|
||||
"**/{vs,sql}/base/common/**",
|
||||
"**/{vs,sql}/base/test/common/**",
|
||||
"**/{vs,sql}/base/parts/*/common/**",
|
||||
"**/{vs,sql}/platform/*/common/**",
|
||||
"**/{vs,sql}/platform/*/test/common/**"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{vs,sql}/platform/*/browser/**",
|
||||
"restrictions": [
|
||||
"vs/nls",
|
||||
"azdata",
|
||||
"vs/css!./**/*",
|
||||
"**/{vs,sql}/base/{common,browser}/**",
|
||||
"**/{vs,sql}/base/parts/*/{common,browser}/**",
|
||||
"**/{vs,sql}/platform/*/{common,browser}/**"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{vs,sql}/platform/*/node/**",
|
||||
"restrictions": [
|
||||
"vs/nls",
|
||||
"azdata",
|
||||
"**/{vs,sql}/base/{common,node}/**",
|
||||
"**/{vs,sql}/base/parts/*/{common,node}/**",
|
||||
"**/{vs,sql}/platform/*/{common,node}/**",
|
||||
"!path" // node modules (except path where we have our own impl)
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{vs,sql}/platform/*/electron-browser/**",
|
||||
"restrictions": [
|
||||
"vs/nls",
|
||||
"azdata",
|
||||
"vs/css!./**/*",
|
||||
"**/{vs,sql}/base/{common,browser,node}/**",
|
||||
"**/{vs,sql}/base/parts/*/{common,browser,node,electron-browser}/**",
|
||||
"**/{vs,sql}/platform/*/{common,browser,node,electron-browser}/**",
|
||||
"!path" // node modules (except path where we have our own impl)
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{vs,sql}/platform/*/electron-main/**",
|
||||
"restrictions": [
|
||||
"vs/nls",
|
||||
"azdata",
|
||||
"**/{vs,sql}/base/{common,node,electron-main}/**",
|
||||
"**/{vs,sql}/base/parts/*/{common,node,electron-main}/**",
|
||||
"**/{vs,sql}/platform/*/{common,node,electron-main}/**",
|
||||
"!path" // node modules (except path where we have our own impl)
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{vs,sql}/platform/*/test/browser/**",
|
||||
"restrictions": [
|
||||
"assert",
|
||||
"typemoq",
|
||||
"sinon",
|
||||
"azdata",
|
||||
"vs/nls",
|
||||
"**/{vs,sql}/base/{common,browser}/**",
|
||||
"**/{vs,sql}/base/test/{common,browser}/**",
|
||||
"**/{vs,sql}/platform/*/{common,browser}/**",
|
||||
"**/{vs,sql}/platform/*/test/{common,browser}/**"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{vs,sql}/editor/common/**",
|
||||
"restrictions": [
|
||||
"vs/nls",
|
||||
"**/{vs,sql}/base/common/**",
|
||||
"**/{vs,sql}/base/worker/**",
|
||||
"**/{vs,sql}/platform/*/common/**",
|
||||
"**/{vs,sql}/editor/common/**"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{vs,sql}/editor/test/common/**",
|
||||
"restrictions": [
|
||||
"assert",
|
||||
"sinon",
|
||||
"vs/nls",
|
||||
"**/{vs,sql}/base/common/**",
|
||||
"**/{vs,sql}/platform/*/common/**",
|
||||
"**/{vs,sql}/platform/*/test/common/**",
|
||||
"**/{vs,sql}/editor/common/**",
|
||||
"**/{vs,sql}/editor/test/common/**"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{vs,sql}/editor/browser/**",
|
||||
"restrictions": [
|
||||
"vs/nls",
|
||||
"vs/css!./**/*",
|
||||
"**/{vs,sql}/base/{common,browser}/**",
|
||||
"**/{vs,sql}/platform/*/{common,browser}/**",
|
||||
"**/{vs,sql}/editor/{common,browser}/**"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{vs,sql}/editor/test/browser/**",
|
||||
"restrictions": [
|
||||
"assert",
|
||||
"sinon",
|
||||
"vs/nls",
|
||||
"**/{vs,sql}/base/{common,browser}/**",
|
||||
"**/{vs,sql}/platform/*/{common,browser}/**",
|
||||
"**/{vs,sql}/platform/*/test/{common,browser}/**",
|
||||
"**/{vs,sql}/editor/{common,browser}/**",
|
||||
"**/{vs,sql}/editor/test/{common,browser}/**"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{vs,sql}/editor/standalone/common/**",
|
||||
"restrictions": [
|
||||
"vs/nls",
|
||||
"**/{vs,sql}/base/common/**",
|
||||
"**/{vs,sql}/platform/*/common/**",
|
||||
"**/{vs,sql}/editor/common/**",
|
||||
"**/{vs,sql}/editor/standalone/common/**"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{vs,sql}/editor/standalone/test/common/**",
|
||||
"restrictions": [
|
||||
"assert",
|
||||
"sinon",
|
||||
"vs/nls",
|
||||
"**/{vs,sql}/base/common/**",
|
||||
"**/{vs,sql}/platform/*/common/**",
|
||||
"**/{vs,sql}/platform/*/test/common/**",
|
||||
"**/{vs,sql}/editor/common/**",
|
||||
"**/{vs,sql}/editor/test/common/**"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{vs,sql}/editor/standalone/browser/**",
|
||||
"restrictions": [
|
||||
"vs/nls",
|
||||
"vs/css!./**/*",
|
||||
"**/{vs,sql}/base/{common,browser}/**",
|
||||
"**/{vs,sql}/base/parts/*/{common,browser}/**",
|
||||
"**/{vs,sql}/platform/*/{common,browser}/**",
|
||||
"**/{vs,sql}/editor/{common,browser}/**",
|
||||
"**/{vs,sql}/editor/contrib/**",
|
||||
"**/{vs,sql}/editor/standalone/{common,browser}/**"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{vs,sql}/editor/standalone/test/browser/**",
|
||||
"restrictions": [
|
||||
"assert",
|
||||
"sinon",
|
||||
"vs/nls",
|
||||
"**/{vs,sql}/base/{common,browser}/**",
|
||||
"**/{vs,sql}/platform/*/{common,browser}/**",
|
||||
"**/{vs,sql}/platform/*/test/{common,browser}/**",
|
||||
"**/{vs,sql}/editor/{common,browser}/**",
|
||||
"**/{vs,sql}/editor/standalone/{common,browser}/**",
|
||||
"**/{vs,sql}/editor/test/{common,browser}/**"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{vs,sql}/editor/contrib/*/test/**",
|
||||
"restrictions": [
|
||||
"assert",
|
||||
"sinon",
|
||||
"vs/nls",
|
||||
"**/{vs,sql}/base/{common,browser}/**",
|
||||
"**/{vs,sql}/base/test/{common,browser}/**",
|
||||
"**/{vs,sql}/base/parts/*/{common,browser}/**",
|
||||
"**/{vs,sql}/platform/*/{common,browser}/**",
|
||||
"**/{vs,sql}/platform/*/test/{common,browser}/**",
|
||||
"**/{vs,sql}/editor/{common,browser}/**",
|
||||
"**/{vs,sql}/editor/test/{common,browser}/**",
|
||||
"**/{vs,sql}/editor/contrib/**"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{vs,sql}/editor/contrib/**",
|
||||
"restrictions": [
|
||||
"vs/nls",
|
||||
"vs/css!./**/*",
|
||||
"**/{vs,sql}/base/{common,browser}/**",
|
||||
"**/{vs,sql}/base/parts/*/{common,browser}/**",
|
||||
"**/{vs,sql}/platform/{common,browser}/**",
|
||||
"**/{vs,sql}/platform/*/{common,browser}/**",
|
||||
"**/{vs,sql}/editor/{common,browser}/**",
|
||||
"**/{vs,sql}/editor/contrib/**"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{vs,sql}/workbench/common/**",
|
||||
"restrictions": [
|
||||
"vs/nls",
|
||||
"azdata",
|
||||
"**/{vs,sql}/base/common/**",
|
||||
"**/{vs,sql}/base/parts/*/common/**",
|
||||
"**/{vs,sql}/platform/*/common/**",
|
||||
"**/{vs,sql}/editor/common/**",
|
||||
"**/{vs,sql}/editor/contrib/*/common/**",
|
||||
"**/{vs,sql}/workbench/common/**",
|
||||
"**/{vs,sql}/workbench/services/*/common/**",
|
||||
"assert"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{vs,sql}/workbench/browser/**",
|
||||
"restrictions": [
|
||||
"vs/nls",
|
||||
"azdata",
|
||||
"@angular/*",
|
||||
"vs/css!./**/*",
|
||||
"**/{vs,sql}/base/{common,browser}/**",
|
||||
"**/{vs,sql}/base/parts/*/{common,browser}/**",
|
||||
"**/{vs,sql}/platform/*/{common,browser}/**",
|
||||
"**/{vs,sql}/editor/{common,browser}/**",
|
||||
"**/{vs,sql}/editor/contrib/**", // editor/contrib is equivalent to /browser/ by convention
|
||||
"**/{vs,sql}/workbench/workbench.web.api",
|
||||
"**/{vs,sql}/workbench/{common,browser}/**",
|
||||
"**/{vs,sql}/workbench/services/*/{common,browser}/**",
|
||||
"assert"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{vs,sql}/workbench/workbench.desktop.main.ts",
|
||||
"restrictions": [
|
||||
"**"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{vs,sql}/workbench/api/common/**",
|
||||
"restrictions": [
|
||||
"vscode",
|
||||
"azdata",
|
||||
"vs/nls",
|
||||
"**/{vs,sql}/base/common/**",
|
||||
"**/{vs,sql}/platform/*/common/**",
|
||||
"**/{vs,sql}/editor/common/**",
|
||||
"**/{vs,sql}/editor/contrib/*/common/**",
|
||||
"**/{vs,sql}/workbench/api/common/**",
|
||||
"**/{vs,sql}/workbench/common/**",
|
||||
"**/{vs,sql}/workbench/services/*/common/**",
|
||||
"**/{vs,sql}/workbench/contrib/*/common/**"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{vs,sql}/workbench/api/worker/**",
|
||||
"restrictions": [
|
||||
"vscode",
|
||||
"azdata",
|
||||
"vs/nls",
|
||||
"**/{vs,sql}/**/{common,worker}/**"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{vs,sql}/workbench/electron-browser/**",
|
||||
"restrictions": [
|
||||
"vs/nls",
|
||||
"vs/css!./**/*",
|
||||
"**/{vs,sql}/base/{common,browser,node,electron-browser}/**",
|
||||
"**/{vs,sql}/base/parts/*/{common,browser,node,electron-browser}/**",
|
||||
"**/{vs,sql}/platform/*/{common,browser,node,electron-browser}/**",
|
||||
"**/{vs,sql}/editor/{common,browser,node,electron-browser}/**",
|
||||
"**/{vs,sql}/editor/contrib/**", // editor/contrib is equivalent to /browser/ by convention
|
||||
"**/{vs,sql}/workbench/{common,browser,node,electron-browser,api}/**",
|
||||
"**/{vs,sql}/workbench/services/*/{common,browser,node,electron-browser}/**",
|
||||
"!path" // node modules (except path where we have our own impl)
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{vs,sql}/workbench/services/**/test/**",
|
||||
"restrictions": [
|
||||
"vs/nls",
|
||||
"vs/css!./**/*",
|
||||
"**/{vs,sql}/base/**",
|
||||
"**/{vs,sql}/platform/**",
|
||||
"**/{vs,sql}/editor/**",
|
||||
"**/{vs,sql}/workbench/{common,browser,node,electron-browser}/**",
|
||||
"vs/workbench/contrib/files/common/editors/fileEditorInput",
|
||||
"**/{vs,sql}/workbench/services/**",
|
||||
"**/{vs,sql}/workbench/test/**",
|
||||
"!path" // node modules (except path where we have our own impl)
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{vs,sql}/workbench/services/**/common/**",
|
||||
"restrictions": [
|
||||
"vs/nls",
|
||||
"azdata",
|
||||
"**/{vs,sql}/base/**/common/**",
|
||||
"**/{vs,sql}/platform/**/common/**",
|
||||
"**/{vs,sql}/editor/common/**",
|
||||
"**/{vs,sql}/workbench/workbench.web.api",
|
||||
"**/{vs,sql}/workbench/common/**",
|
||||
"**/{vs,sql}/workbench/services/**/common/**",
|
||||
"**/{vs,sql}/workbench/api/**/common/**",
|
||||
"vs/workbench/contrib/files/common/editors/fileEditorInput", // this should be fine, it only accesses constants from contrib
|
||||
"vscode-textmate"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{vs,sql}/workbench/services/**/worker/**",
|
||||
"restrictions": [
|
||||
"vs/nls",
|
||||
"**/{vs,sql}/base/**/common/**",
|
||||
"**/{vs,sql}/platform/**/common/**",
|
||||
"**/{vs,sql}/editor/common/**",
|
||||
"**/{vs,sql}/workbench/**/common/**",
|
||||
"**/{vs,sql}/workbench/**/worker/**",
|
||||
"**/{vs,sql}/workbench/services/**/common/**",
|
||||
"vscode"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{vs,sql}/workbench/services/**/browser/**",
|
||||
"restrictions": [
|
||||
"vs/nls",
|
||||
"vs/css!./**/*",
|
||||
"azdata",
|
||||
"vscode",
|
||||
"**/{vs,sql}/base/**/{common,browser,worker}/**",
|
||||
"**/{vs,sql}/platform/**/{common,browser}/**",
|
||||
"**/{vs,sql}/editor/{common,browser}/**",
|
||||
"**/{vs,sql}/workbench/workbench.web.api",
|
||||
"**/{vs,sql}/workbench/{common,browser}/**",
|
||||
"**/{vs,sql}/workbench/api/{common,browser}/**",
|
||||
"**/{vs,sql}/workbench/services/**/{common,browser}/**",
|
||||
"vscode-textmate",
|
||||
"onigasm-umd",
|
||||
"sanitize-html",
|
||||
"@angular/*",
|
||||
"rxjs/**"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{vs,sql}/workbench/services/**/node/**",
|
||||
"restrictions": [
|
||||
"vs/nls",
|
||||
"**/{vs,sql}/base/**/{common,node}/**",
|
||||
"**/{vs,sql}/platform/**/{common,node}/**",
|
||||
"**/{vs,sql}/editor/{common,node}/**",
|
||||
"**/{vs,sql}/workbench/{common,node}/**",
|
||||
"**/{vs,sql}/workbench/api/{common,node}/**",
|
||||
"**/{vs,sql}/workbench/services/**/{common,node}/**",
|
||||
"!path" // node modules (except path where we have our own impl)
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{vs,sql}/workbench/services/**/electron-browser/**",
|
||||
"restrictions": [
|
||||
"vs/nls",
|
||||
"vs/css!./**/*",
|
||||
"**/{vs,sql}/base/**/{common,browser,worker,node,electron-browser}/**",
|
||||
"**/{vs,sql}/platform/**/{common,browser,node,electron-browser}/**",
|
||||
"**/{vs,sql}/editor/**",
|
||||
"**/{vs,sql}/workbench/{common,browser,node,electron-browser,api}/**",
|
||||
"**/{vs,sql}/workbench/services/**/{common,browser,node,electron-browser}/**",
|
||||
"!path" // node modules (except path where we have our own impl)
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{vs,sql}/workbench/contrib/terminal/browser/**",
|
||||
"restrictions": [
|
||||
// xterm and its addons are strictly browser-only components
|
||||
"xterm",
|
||||
"xterm-addon-*",
|
||||
"**/{vs,sql}/**"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{vs,sql}/workbench/contrib/extensions/browser/**",
|
||||
"restrictions": [
|
||||
"semver-umd",
|
||||
"**/{vs,sql}/**"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{vs,sql}/workbench/contrib/update/browser/update.ts",
|
||||
"restrictions": [
|
||||
"semver-umd",
|
||||
"**/{vs,sql}/**"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{vs,sql}/code/node/**",
|
||||
"restrictions": [
|
||||
"vs/nls",
|
||||
"**/{vs,sql}/base/**/{common,node}/**",
|
||||
"**/{vs,sql}/base/parts/**/{common,node}/**",
|
||||
"**/{vs,sql}/platform/**/{common,node}/**",
|
||||
"**/{vs,sql}/code/**/{common,node}/**",
|
||||
"!path" // node modules (except path where we have our own impl)
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{vs,sql}/code/electron-browser/**",
|
||||
"restrictions": [
|
||||
"vs/nls",
|
||||
"vs/css!./**/*",
|
||||
"**/{vs,sql}/base/**/{common,browser,node,electron-browser}/**",
|
||||
"**/{vs,sql}/base/parts/**/{common,browser,node,electron-browser}/**",
|
||||
"**/{vs,sql}/platform/**/{common,browser,node,electron-browser}/**",
|
||||
"**/{vs,sql}/code/**/{common,browser,node,electron-browser}/**",
|
||||
"!path" // node modules (except path where we have our own impl)
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{vs,sql}/code/electron-main/**",
|
||||
"restrictions": [
|
||||
"vs/nls",
|
||||
"**/{vs,sql}/base/**/{common,node,electron-main}/**",
|
||||
"**/{vs,sql}/base/parts/**/{common,node,electron-main}/**",
|
||||
"**/{vs,sql}/platform/**/{common,node,electron-main}/**",
|
||||
"**/{vs,sql}/code/**/{common,node,electron-main}/**",
|
||||
"!path" // node modules (except path where we have our own impl)
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{vs,sql}/server/**",
|
||||
"restrictions": [
|
||||
"vs/nls",
|
||||
"**/{vs,sql}/base/**/{common,node}/**",
|
||||
"**/{vs,sql}/base/parts/**/{common,node}/**",
|
||||
"**/{vs,sql}/platform/**/{common,node}/**",
|
||||
"**/{vs,sql}/workbench/**/{common,node}/**",
|
||||
"**/{vs,sql}/server/**",
|
||||
"**/{vs,sql}/code/**/{common,node}/**",
|
||||
"!path" // node modules (except path where we have our own impl)
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{node,electron-browser,electron-main}/**",
|
||||
"restrictions": "**/*"
|
||||
},
|
||||
{
|
||||
"target": "**/extensions/**",
|
||||
"restrictions": "**/*"
|
||||
},
|
||||
{
|
||||
"target": "**/test/smoke/**",
|
||||
"restrictions": [
|
||||
"**/test/smoke/**",
|
||||
"*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/test/automation/**",
|
||||
"restrictions": [
|
||||
"**/test/automation/**",
|
||||
"*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/test/integration/**",
|
||||
"restrictions": [
|
||||
"**/test/integration/**",
|
||||
"*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "{**/api/**.test.ts,}",
|
||||
"restrictions": "{**/{vs,sql}/**,assert,sinon,crypto,vscode,typemoq,azdata}"
|
||||
},
|
||||
{
|
||||
"target": "{**/**.test.ts,**/test/**}",
|
||||
"restrictions": "{**/{vs,sql}/**,assert,sinon,crypto,xterm*,vscode,typemoq,azdata}"
|
||||
},
|
||||
{
|
||||
"target": "**/browser/**",
|
||||
"restrictions": [
|
||||
"**/{vs,sql}/**",
|
||||
"azdata",
|
||||
"vscode",
|
||||
"@angular/*",
|
||||
"rxjs/**",
|
||||
"chart.js",
|
||||
"ng2-charts",
|
||||
"angular2-grid",
|
||||
"html-query-plan",
|
||||
"plotly.js-dist"
|
||||
]
|
||||
},
|
||||
{
|
||||
"target": "**/{common,browser,workbench}/**",
|
||||
"restrictions": ["**/{vs,sql}/**","azdata","vscode"]
|
||||
}
|
||||
]
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"files": [
|
||||
"*.js"
|
||||
],
|
||||
"rules": {
|
||||
"jsdoc/no-types": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": [
|
||||
"**/sql/**"
|
||||
],
|
||||
"rules": {
|
||||
"no-sync": "warn",
|
||||
"strict": ["warn", "never"],
|
||||
"no-console": "warn"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": [
|
||||
"**/vscode.d.ts",
|
||||
"**/vscode.proposed.d.ts"
|
||||
],
|
||||
"rules": {
|
||||
"vscode-dts-create-func": "warn",
|
||||
"vscode-dts-literal-or-types": "warn",
|
||||
"vscode-dts-interface-naming": "warn",
|
||||
"vscode-dts-event-naming": [
|
||||
"warn",
|
||||
{
|
||||
"allowed": [
|
||||
"onCancellationRequested",
|
||||
"event"
|
||||
],
|
||||
"verbs": [
|
||||
"accept",
|
||||
"change",
|
||||
"close",
|
||||
"collapse",
|
||||
"create",
|
||||
"delete",
|
||||
"dispose",
|
||||
"edit",
|
||||
"end",
|
||||
"expand",
|
||||
"hide",
|
||||
"open",
|
||||
"override",
|
||||
"receive",
|
||||
"register",
|
||||
"rename",
|
||||
"save",
|
||||
"send",
|
||||
"start",
|
||||
"terminate",
|
||||
"trigger",
|
||||
"unregister",
|
||||
"write"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
20
.eslintrc.sql.ts.json
Normal file
20
.eslintrc.sql.ts.json
Normal file
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 6,
|
||||
"sourceType": "module",
|
||||
"project": "./tsconfig.sql.json"
|
||||
},
|
||||
"plugins": [
|
||||
"@typescript-eslint",
|
||||
"jsdoc"
|
||||
],
|
||||
"rules": {
|
||||
"@typescript-eslint/no-floating-promises": [
|
||||
"error",
|
||||
{
|
||||
"ignoreVoid": true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
2
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -6,7 +6,7 @@ labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
|
||||
<!-- Please search existing issues to avoid creating duplicates. -->
|
||||
<!-- Also please test using the latest insiders build to make sure your issue has not already been fixed. -->
|
||||
|
||||
|
||||
34
.github/feature-requests.yml
vendored
Normal file
34
.github/feature-requests.yml
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
{
|
||||
typeLabel: {
|
||||
name: 'feature-request'
|
||||
},
|
||||
candidateMilestone: {
|
||||
number: 107,
|
||||
name: 'Backlog Candidates'
|
||||
},
|
||||
approvedMilestone: {
|
||||
number: 8,
|
||||
name: 'Backlog'
|
||||
},
|
||||
onLabeled: {
|
||||
delay: 60,
|
||||
perform: true
|
||||
},
|
||||
onCandidateMilestoned: {
|
||||
candidatesComment: "This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our [documentation](https://aka.ms/vscode-issue-lifecycle).\n\nHappy Coding!",
|
||||
perform: true
|
||||
},
|
||||
onMonitorUpvotes: {
|
||||
upvoteThreshold: 20,
|
||||
acceptanceComment: ":slightly_smiling_face: This feature request received a sufficient number of community upvotes and we moved it to our backlog. To learn more about how we handle feature requests, please see our [documentation](https://aka.ms/vscode-issue-lifecycle).\n\nHappy Coding!",
|
||||
perform: true
|
||||
},
|
||||
onMonitorDaysOnCandidateMilestone: {
|
||||
daysOnMilestone: 60,
|
||||
warningPeriod: 10,
|
||||
numberOfCommentsToPreventAutomaticRejection: 20,
|
||||
rejectionComment: ":slightly_frowning_face: In the last 60 days, this feature request has received less than 20 community upvotes and we closed it. Still a big Thank You to you for taking the time to create this issue! To learn more about how we handle feature requests, please see our [documentation](https://aka.ms/vscode-issue-lifecycle).\n\nHappy Coding!",
|
||||
warningComment: "This feature request has not yet received the 20 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our [documentation](https://aka.ms/vscode-issue-lifecycle).\n\nHappy Coding",
|
||||
perform: true
|
||||
}
|
||||
}
|
||||
2
.github/locker.yml
vendored
2
.github/locker.yml
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
daysAfterClose: 45,
|
||||
daysSinceLastUpdate: 3,
|
||||
ignoredLabels: [],
|
||||
ignoredLabels: ['A11y_ADS_OctTestPass', 'A11y_ADS_Schema_Dacpac_Backup', 'A11y_AzureDataStudio', 'A11yExclusion', 'A11yMAS', 'A11yResolved: Will Not Fix', 'A11yTCS'],
|
||||
perform: true
|
||||
}
|
||||
|
||||
7
.github/mergers.json
vendored
Normal file
7
.github/mergers.json
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
[
|
||||
"kenvanhyning",
|
||||
"kburtram",
|
||||
"udeeshagautam",
|
||||
"qifahs",
|
||||
"chlafreniere"
|
||||
]
|
||||
77
.github/workflows/ci.yml
vendored
77
.github/workflows/ci.yml
vendored
@@ -35,22 +35,25 @@ jobs:
|
||||
name: Install Dependencies
|
||||
- run: yarn electron x64
|
||||
name: Download Electron
|
||||
- run: yarn gulp hygiene --skip-tslint
|
||||
- run: yarn gulp hygiene
|
||||
name: Run Hygiene Checks
|
||||
- run: yarn gulp tslint
|
||||
name: Run TSLint Checks
|
||||
- run: yarn strict-null-check # {{SQL CARBON EDIT}} add step
|
||||
name: Run Strict Null Check
|
||||
- run: yarn strict-vscode # {{SQL CARBON EDIT}} add step
|
||||
name: Run Strict Compile Options
|
||||
# - run: yarn monaco-compile-check {{SQL CARBON EDIT}} remove step
|
||||
# name: Run Monaco Editor Checks
|
||||
- run: yarn valid-layers-check
|
||||
name: Run Valid Layers Checks
|
||||
- run: yarn compile
|
||||
name: Compile Sources
|
||||
# - run: yarn download-builtin-extensions {{SQL CARBON EDIT}} remove step
|
||||
# name: Download Built-in Extensions
|
||||
- run: DISPLAY=:10 ./scripts/test.sh --tfs "Unit Tests"
|
||||
name: Run Unit Tests
|
||||
name: Run Unit Tests (Electron)
|
||||
# Fails with cryptic error (e.g. https://github.com/microsoft/vscode/pull/90292/checks?check_run_id=433681926#step:13:9)
|
||||
# - run: DISPLAY=:10 yarn test-browser --browser chromium
|
||||
# name: Run Unit Tests (Browser)
|
||||
# - run: DISPLAY=:10 ./scripts/test-integration.sh --tfs "Integration Tests" {{SQL CARBON EDIT}} remove step
|
||||
# name: Run Integration Tests
|
||||
# name: Run Integration Tests (Electron)
|
||||
|
||||
windows:
|
||||
runs-on: windows-2016
|
||||
@@ -69,22 +72,24 @@ jobs:
|
||||
name: Install Dependencies
|
||||
- run: yarn electron
|
||||
name: Download Electron
|
||||
- run: yarn gulp hygiene --skip-tslint
|
||||
- run: yarn gulp hygiene
|
||||
name: Run Hygiene Checks
|
||||
- run: yarn gulp tslint
|
||||
name: Run TSLint Checks
|
||||
- run: yarn strict-null-check # {{SQL CARBON EDIT}} add step
|
||||
name: Run Strict Null Check
|
||||
- run: yarn strict-vscode # {{SQL CARBON EDIT}} add step
|
||||
name: Run Strict Compile Options
|
||||
# - run: yarn monaco-compile-check {{SQL CARBON EDIT}} remove step
|
||||
# name: Run Monaco Editor Checks
|
||||
- run: yarn valid-layers-check
|
||||
name: Run Valid Layers Checks
|
||||
- run: yarn compile
|
||||
name: Compile Sources
|
||||
# - run: yarn download-builtin-extensions {{SQL CARBON EDIT}} remove step
|
||||
# name: Download Built-in Extensions
|
||||
- run: .\scripts\test.bat --tfs "Unit Tests"
|
||||
name: Run Unit Tests
|
||||
name: Run Unit Tests (Electron)
|
||||
# - run: yarn test-browser --browser chromium {{SQL CARBON EDIT}} disable for now @TODO @anthonydresser
|
||||
# name: Run Unit Tests (Browser)
|
||||
# - run: .\scripts\test-integration.bat --tfs "Integration Tests" {{SQL CARBON EDIT}} remove step
|
||||
# name: Run Integration Tests
|
||||
# name: Run Integration Tests (Electron)
|
||||
|
||||
darwin:
|
||||
runs-on: macos-latest
|
||||
@@ -100,19 +105,47 @@ jobs:
|
||||
name: Install Dependencies
|
||||
- run: yarn electron x64
|
||||
name: Download Electron
|
||||
- run: yarn gulp hygiene --skip-tslint
|
||||
- run: yarn gulp hygiene
|
||||
name: Run Hygiene Checks
|
||||
- run: yarn gulp tslint
|
||||
name: Run TSLint Checks
|
||||
- run: yarn strict-null-check # {{SQL CARBON EDIT}} add step
|
||||
name: Run Strict Null Check
|
||||
- run: yarn strict-vscode # {{SQL CARBON EDIT}} add step
|
||||
name: Run Strict Compile Options
|
||||
# - run: yarn monaco-compile-check {{SQL CARBON EDIT}} remove step
|
||||
# name: Run Monaco Editor Checks
|
||||
- run: yarn valid-layers-check
|
||||
name: Run Valid Layers Checks
|
||||
- run: yarn compile
|
||||
name: Compile Sources
|
||||
# - run: yarn download-builtin-extensions {{SQL CARBON EDIT}} remove step
|
||||
# name: Download Built-in Extensions
|
||||
- run: ./scripts/test.sh --tfs "Unit Tests"
|
||||
name: Run Unit Tests
|
||||
# - run: ./scripts/test-integration.sh --tfs "Integration Tests" {{SQL CARBON EDIT}} remove step
|
||||
# name: Run Integration Tests
|
||||
name: Run Unit Tests (Electron)
|
||||
# - run: yarn test-browser --browser chromium --browser webkit
|
||||
# name: Run Unit Tests (Browser)
|
||||
# - run: ./scripts/test-integration.sh --tfs "Integration Tests"
|
||||
# name: Run Integration Tests (Electron)
|
||||
|
||||
# monaco:
|
||||
# runs-on: ubuntu-latest
|
||||
# env:
|
||||
# CHILD_CONCURRENCY: "1"
|
||||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
# steps:
|
||||
# - uses: actions/checkout@v1
|
||||
# # TODO: rename azure-pipelines/linux/xvfb.init to github-actions
|
||||
# - run: |
|
||||
# sudo apt-get update
|
||||
# sudo apt-get install -y libxkbfile-dev pkg-config libsecret-1-dev libxss1 dbus xvfb libgtk-3-0 libgbm1
|
||||
# sudo cp build/azure-pipelines/linux/xvfb.init /etc/init.d/xvfb
|
||||
# sudo chmod +x /etc/init.d/xvfb
|
||||
# sudo update-rc.d xvfb defaults
|
||||
# sudo service xvfb start
|
||||
# name: Setup Build Environment
|
||||
# - uses: actions/setup-node@v1
|
||||
# with:
|
||||
# node-version: 10
|
||||
# - run: yarn --frozen-lockfile
|
||||
# name: Install Dependencies
|
||||
# - run: yarn monaco-compile-check
|
||||
# name: Run Monaco Editor Checks
|
||||
# - run: yarn gulp editor-esm-bundle
|
||||
# name: Editor Distro & ESM Bundle
|
||||
|
||||
16
.github/workflows/merger.yml
vendored
Normal file
16
.github/workflows/merger.yml
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
name: AutoMerger
|
||||
|
||||
on:
|
||||
issue_comment:
|
||||
types: [created]
|
||||
|
||||
jobs:
|
||||
release_labeler:
|
||||
name: Auto Merger
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v2
|
||||
- uses: ./build/actions/AutoMerge
|
||||
env:
|
||||
GITHUB_TOKEN: "${{ secrets.GithubMerger }}"
|
||||
19
.github/workflows/portlabel.yml
vendored
Normal file
19
.github/workflows/portlabel.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
name: Port Request Labeler
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- release/**
|
||||
|
||||
jobs:
|
||||
release_labeler:
|
||||
name: Release labeler
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out repository
|
||||
uses: actions/checkout@v2
|
||||
- uses: ./build/actions/AutoLabel
|
||||
env:
|
||||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
||||
with:
|
||||
label: "Port Request"
|
||||
13
.github/workflows/tslint.yml
vendored
13
.github/workflows/tslint.yml
vendored
@@ -1,13 +0,0 @@
|
||||
name: TSLint Enforcement
|
||||
on: [pull_request]
|
||||
jobs:
|
||||
job:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: TSLint
|
||||
uses: aaomidi/gh-action-tslint@master
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
tslint_config: 'tslint-sql.json'
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -11,6 +11,7 @@ out-editor/
|
||||
out-editor-src/
|
||||
out-editor-build/
|
||||
out-editor-esm/
|
||||
out-editor-esm-bundle/
|
||||
out-editor-min/
|
||||
out-monaco-editor-core/
|
||||
out-vscode/
|
||||
|
||||
1
.vscode/extensions.json
vendored
1
.vscode/extensions.json
vendored
@@ -2,7 +2,6 @@
|
||||
// See https://go.microsoft.com/fwlink/?LinkId=827846
|
||||
// for the documentation about the extensions.json format
|
||||
"recommendations": [
|
||||
"ms-vscode.vscode-typescript-tslint-plugin",
|
||||
"dbaeumer.vscode-eslint",
|
||||
"EditorConfig.EditorConfig",
|
||||
"msjsdiag.debugger-for-chrome"
|
||||
|
||||
99
.vscode/launch.json
vendored
99
.vscode/launch.json
vendored
@@ -16,8 +16,6 @@
|
||||
"request": "attach",
|
||||
"name": "Attach to Extension Host",
|
||||
"port": 5870,
|
||||
"timeout": 30000,
|
||||
"restart": true,
|
||||
"outFiles": [
|
||||
"${workspaceFolder}/out/**/*.js"
|
||||
]
|
||||
@@ -36,7 +34,10 @@
|
||||
"port": 5876,
|
||||
"outFiles": [
|
||||
"${workspaceFolder}/out/**/*.js"
|
||||
]
|
||||
],
|
||||
"presentation": {
|
||||
"hidden": true,
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "node",
|
||||
@@ -54,7 +55,10 @@
|
||||
"port": 5875,
|
||||
"outFiles": [
|
||||
"${workspaceFolder}/out/**/*.js"
|
||||
]
|
||||
],
|
||||
"presentation": {
|
||||
"hidden": true,
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "chrome",
|
||||
@@ -84,9 +88,14 @@
|
||||
"urlFilter": "*workbench.html*",
|
||||
"runtimeArgs": [
|
||||
"--inspect=5875",
|
||||
"--no-cached-data"
|
||||
"--no-cached-data",
|
||||
],
|
||||
"webRoot": "${workspaceFolder}",
|
||||
// Settings for js-debug:
|
||||
"pauseForSourceMap": false,
|
||||
"outFiles": [
|
||||
"${workspaceFolder}/out/**/*.js"
|
||||
],
|
||||
"webRoot": "${workspaceFolder}"
|
||||
},
|
||||
{
|
||||
"type": "node",
|
||||
@@ -101,7 +110,11 @@
|
||||
],
|
||||
"outFiles": [
|
||||
"${workspaceFolder}/out/**/*.js"
|
||||
]
|
||||
],
|
||||
"presentation": {
|
||||
"group": "2_launch",
|
||||
"order": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "chrome",
|
||||
@@ -135,13 +148,21 @@
|
||||
"runtimeArgs": [
|
||||
"web"
|
||||
],
|
||||
"presentation": {
|
||||
"group": "2_launch",
|
||||
"order": 2
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "chrome",
|
||||
"request": "launch",
|
||||
"name": "Launch ADS (Web, Chrome) (TBD)",
|
||||
"url": "http://localhost:8080",
|
||||
"preLaunchTask": "Run web"
|
||||
"preLaunchTask": "Run web",
|
||||
"presentation": {
|
||||
"group": "2_launch",
|
||||
"order": 3
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "node",
|
||||
@@ -152,16 +173,11 @@
|
||||
"cwd": "${workspaceFolder}/extensions/git",
|
||||
"outFiles": [
|
||||
"${workspaceFolder}/extensions/git/out/**/*.js"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Launch Built-in Extension",
|
||||
"type": "extensionHost",
|
||||
"request": "launch",
|
||||
"runtimeExecutable": "${execPath}",
|
||||
"args": [
|
||||
"--extensionDevelopmentPath=${workspaceRoot}/extensions/debug-auto-launch"
|
||||
]
|
||||
],
|
||||
"presentation": {
|
||||
"group": "5_tests",
|
||||
"order": 10
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "node",
|
||||
@@ -171,13 +187,17 @@
|
||||
"cwd": "${workspaceFolder}/test/smoke",
|
||||
"env": {
|
||||
"BUILD_ARTIFACTSTAGINGDIRECTORY": "${workspaceFolder}"
|
||||
},
|
||||
"presentation": {
|
||||
"group": "5_tests",
|
||||
"order": 8
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"name": "Run Unit Tests",
|
||||
"program": "${workspaceFolder}/test/electron/index.js",
|
||||
"program": "${workspaceFolder}/test/unit/electron/index.js",
|
||||
"runtimeExecutable": "${workspaceFolder}/.build/electron/Azure Data Studio.app/Contents/MacOS/Electron",
|
||||
"windows": {
|
||||
"runtimeExecutable": "${workspaceFolder}/.build/electron/azuredatastudio.exe"
|
||||
@@ -195,6 +215,9 @@
|
||||
],
|
||||
"env": {
|
||||
"MOCHA_COLORS": "true"
|
||||
},
|
||||
"presentation": {
|
||||
"hidden": true
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -245,19 +268,16 @@
|
||||
"Run Extension Unit Tests"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Debug Extension Integration Tests",
|
||||
"configurations": [
|
||||
"Attach to Extension Host",
|
||||
"Run Extension Integration Tests"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Debug azuredatastudio Main and Renderer",
|
||||
"configurations": [
|
||||
"Launch azuredatastudio",
|
||||
"Attach to Main Process"
|
||||
]
|
||||
],
|
||||
"presentation": {
|
||||
"group": "1_vscode",
|
||||
"order": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Debug azuredatastudio Main, Renderer & Extension Host",
|
||||
@@ -265,28 +285,33 @@
|
||||
"Launch azuredatastudio",
|
||||
"Attach to Main Process",
|
||||
"Attach to Extension Host"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Debug Renderer and search processes",
|
||||
"configurations": [
|
||||
"Launch azuredatastudio",
|
||||
"Attach to Search Process"
|
||||
]
|
||||
],
|
||||
"presentation": {
|
||||
"group": "1_vscode",
|
||||
"order": 3
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Debug Renderer and Extension Host processes",
|
||||
"configurations": [
|
||||
"Launch azuredatastudio",
|
||||
"Attach to Extension Host"
|
||||
]
|
||||
],
|
||||
"presentation": {
|
||||
"group": "1_vscode",
|
||||
"order": 2
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Attach Renderer and Extension Host",
|
||||
"configurations": [
|
||||
"Attach to azuredatastudio",
|
||||
"Attach to Extension Host"
|
||||
]
|
||||
],
|
||||
"presentation": {
|
||||
"group": "1_vscode",
|
||||
"order": 2
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
9
.vscode/searches/ts36031.code-search
vendored
Normal file
9
.vscode/searches/ts36031.code-search
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
# Query: \\w+\\?\\..+![(.[]
|
||||
# Flags: RegExp
|
||||
# ContextLines: 2
|
||||
src/vs/base/browser/ui/tree/asyncDataTree.ts:
|
||||
270 } : undefined,
|
||||
271 isChecked: options.ariaProvider!.isChecked ? (e) => {
|
||||
272: return options.ariaProvider?.isChecked!(e.element as T);
|
||||
273 } : undefined
|
||||
274 },
|
||||
7
.vscode/settings.json
vendored
7
.vscode/settings.json
vendored
@@ -22,6 +22,8 @@
|
||||
"i18n/**": true,
|
||||
"extensions/**/out/**": true,
|
||||
"test/smoke/out/**": true,
|
||||
"test/automation/out/**": true,
|
||||
"test/integration/browser/out/**": true,
|
||||
"src/vs/base/test/node/uri.test.data.txt": true
|
||||
},
|
||||
"lcov.path": [
|
||||
@@ -37,6 +39,11 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
"eslint.options": {
|
||||
"rulePaths": [
|
||||
"./build/lib/eslint"
|
||||
]
|
||||
},
|
||||
"typescript.tsdk": "node_modules/typescript/lib",
|
||||
"npm.exclude": "**/extensions/**",
|
||||
"npm.packageManager": "yarn",
|
||||
|
||||
37
.vscode/tasks.json
vendored
37
.vscode/tasks.json
vendored
@@ -33,40 +33,18 @@
|
||||
},
|
||||
{
|
||||
"type": "npm",
|
||||
"script": "strict-function-types-watch",
|
||||
"label": "TS - Strict Function Types",
|
||||
"script": "strict-vscode-watch",
|
||||
"label": "TS - Strict VSCode",
|
||||
"isBackground": true,
|
||||
"presentation": {
|
||||
"reveal": "never"
|
||||
},
|
||||
"problemMatcher": {
|
||||
"base": "$tsc-watch",
|
||||
"owner": "typescript-function-types",
|
||||
"owner": "typescript-vscode",
|
||||
"applyTo": "allDocuments"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "npm",
|
||||
"script": "strict-null-check-watch",
|
||||
"label": "TS - Strict Null Checks",
|
||||
"isBackground": true,
|
||||
"presentation": {
|
||||
"reveal": "never"
|
||||
},
|
||||
"problemMatcher": {
|
||||
"base": "$tsc-watch",
|
||||
"owner": "typescript-strict-null-checks",
|
||||
"applyTo": "allDocuments"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "gulp",
|
||||
"task": "tslint",
|
||||
"label": "Run tslint",
|
||||
"problemMatcher": [
|
||||
"$tslint5"
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "Run tests",
|
||||
"type": "shell",
|
||||
@@ -104,7 +82,6 @@
|
||||
"command": "yarn web -- --no-launch",
|
||||
"label": "Run web",
|
||||
"isBackground": true,
|
||||
// This section to make error go away when launching the debug config
|
||||
"problemMatcher": {
|
||||
"pattern": {
|
||||
"regexp": ""
|
||||
@@ -118,5 +95,13 @@
|
||||
"reveal": "never"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "npm",
|
||||
"script": "eslint",
|
||||
"problemMatcher": {
|
||||
"source": "eslint",
|
||||
"base": "$eslint-stylish"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
2
.yarnrc
2
.yarnrc
@@ -1,3 +1,3 @@
|
||||
disturl "https://atom.io/download/electron"
|
||||
target "6.1.5"
|
||||
target "7.1.11"
|
||||
runtime "electron"
|
||||
|
||||
32
CHANGELOG.md
32
CHANGELOG.md
@@ -1,5 +1,37 @@
|
||||
# Change Log
|
||||
|
||||
## Version 1.15.1
|
||||
* Release date: February 19, 2020
|
||||
* Release status: General Availability
|
||||
* Resolved [#9145 Edit Data render the result grid incorrectly when using custom query](https://github.com/microsoft/azuredatastudio/issues/9145).
|
||||
* Resolved [#9149 Show Active Connections](https://github.com/microsoft/azuredatastudio/issues/9149).
|
||||
|
||||
## Version 1.15.0
|
||||
* Release date: February 13, 2020
|
||||
* Release status: General Availability
|
||||
* New Azure Sign-in improvement - Added improved Azure Sign-in experience, including removal of copy/paste of device code to make a more seamless connected experience.
|
||||
* Find in Notebook support - Users can now use Ctrl+F inside of a notebook. Find in Notebook support searches line by line through both code and text cells.
|
||||
* VS Code merge from 1.38 to 1.42 - This release includes updates to VS Code from the 3 previous VS Code releases. Read their [release notes](https://code.visualstudio.com/updates/v1_42) to learn more.
|
||||
* Fix for the ["white/blank screen"](https://github.com/microsoft/azuredatastudio/issues/8775) issue reported by many users.
|
||||
* Resolved [bugs and issues](https://github.com/microsoft/azuredatastudio/issues?q=is%3Aissue+label%3ABug+milestone%3A%22February+2020%22+is%3Aclosed).
|
||||
|
||||
## Version 1.14.1
|
||||
* Release date: December 26, 2019
|
||||
* Release status: General Availability
|
||||
* Hotfix for bug https://github.com/microsoft/azuredatastudio/issues/8768
|
||||
|
||||
## Version 1.14.0
|
||||
* Release date: December 19, 2019
|
||||
* Release status: General Availability
|
||||
* Added bigdatacluster.ignoreSslVerification setting to allow ignoring SSL verification errors when connecting to a BDC [#8129](https://github.com/microsoft/azuredatastudio/issues/8129)
|
||||
* Changed attach to connection dropdown in Notebooks to only list the currently active connection [#8582](https://github.com/microsoft/azuredatastudio/pull/8582)
|
||||
* Allow changing default language flavor for offline query editors [#8419](https://github.com/microsoft/azuredatastudio/pull/8419)
|
||||
* GA status for Big Data Cluster/SQL 2019 features [#8269](https://github.com/microsoft/azuredatastudio/issues/8269)
|
||||
* Resolved [bugs and issues](https://github.com/microsoft/azuredatastudio/milestone/44?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:
|
||||
|
||||
## Version 1.13.1
|
||||
* Release date: November 15, 2019
|
||||
* Release status: General Availability
|
||||
|
||||
14
README.md
14
README.md
@@ -10,13 +10,13 @@ Azure Data Studio is a data management tool that enables you to work with SQL Se
|
||||
|
||||
Platform | Link
|
||||
-- | --
|
||||
Windows User Installer | https://go.microsoft.com/fwlink/?linkid=2109256
|
||||
Windows System Installer | https://go.microsoft.com/fwlink/?linkid=2109085
|
||||
Windows ZIP | https://go.microsoft.com/fwlink/?linkid=2109255
|
||||
macOS ZIP | https://go.microsoft.com/fwlink/?linkid=2109180
|
||||
Linux TAR.GZ | https://go.microsoft.com/fwlink/?linkid=2109179
|
||||
Linux RPM | https://go.microsoft.com/fwlink/?linkid=2109178
|
||||
Linux DEB | https://go.microsoft.com/fwlink/?linkid=2109254
|
||||
Windows User Installer | https://go.microsoft.com/fwlink/?linkid=2116782
|
||||
Windows System Installer | https://go.microsoft.com/fwlink/?linkid=2116781
|
||||
Windows ZIP | https://go.microsoft.com/fwlink/?linkid=2116691
|
||||
macOS ZIP | https://go.microsoft.com/fwlink/?linkid=2116692
|
||||
Linux TAR.GZ | https://go.microsoft.com/fwlink/?linkid=2116783
|
||||
Linux RPM | https://go.microsoft.com/fwlink/?linkid=2116779
|
||||
Linux DEB | https://go.microsoft.com/fwlink/?linkid=2116780
|
||||
|
||||
Go to our [download page](https://aka.ms/azuredatastudio) for more specific instructions.
|
||||
|
||||
|
||||
@@ -17,6 +17,6 @@ jobs:
|
||||
|
||||
- job: macOS
|
||||
pool:
|
||||
vmImage: macOS 10.13
|
||||
vmImage: macOS-latest
|
||||
steps:
|
||||
- template: build/azure-pipelines/darwin/continuous-build-darwin.yml
|
||||
|
||||
@@ -108,6 +108,8 @@ jquery-ui/demos/**
|
||||
slickgrid/node_modules/**
|
||||
slickgrid/examples/**
|
||||
|
||||
kerberos/build/**
|
||||
|
||||
# END SQL Modules
|
||||
|
||||
nsfw/binding.gyp
|
||||
|
||||
17
build/actions/AutoLabel/.eslintrc.json
Normal file
17
build/actions/AutoLabel/.eslintrc.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"env": {
|
||||
"commonjs": true,
|
||||
"es6": true,
|
||||
"node": true
|
||||
},
|
||||
"extends": "eslint:recommended",
|
||||
"globals": {
|
||||
"Atomics": "readonly",
|
||||
"SharedArrayBuffer": "readonly"
|
||||
},
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2018
|
||||
},
|
||||
"rules": {
|
||||
}
|
||||
}
|
||||
98
build/actions/AutoLabel/.gitignore
vendored
Normal file
98
build/actions/AutoLabel/.gitignore
vendored
Normal file
@@ -0,0 +1,98 @@
|
||||
|
||||
# Created by https://www.gitignore.io/api/node
|
||||
# Edit at https://www.gitignore.io/?templates=node
|
||||
|
||||
### Node ###
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
lerna-debug.log*
|
||||
|
||||
# Diagnostic reports (https://nodejs.org/api/report.html)
|
||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
||||
|
||||
# Runtime data
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
*.pid.lock
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
*.lcov
|
||||
|
||||
# nyc test coverage
|
||||
.nyc_output
|
||||
|
||||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
||||
.grunt
|
||||
|
||||
# Bower dependency directory (https://bower.io/)
|
||||
bower_components
|
||||
|
||||
# node-waf configuration
|
||||
.lock-wscript
|
||||
|
||||
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# TypeScript v1 declaration files
|
||||
typings/
|
||||
|
||||
# TypeScript cache
|
||||
*.tsbuildinfo
|
||||
|
||||
# Optional npm cache directory
|
||||
.npm
|
||||
|
||||
# Optional eslint cache
|
||||
.eslintcache
|
||||
|
||||
# Optional REPL history
|
||||
.node_repl_history
|
||||
|
||||
# Output of 'npm pack'
|
||||
*.tgz
|
||||
|
||||
# Yarn Integrity file
|
||||
.yarn-integrity
|
||||
|
||||
# dotenv environment variables file
|
||||
.env
|
||||
.env.test
|
||||
|
||||
# parcel-bundler cache (https://parceljs.org/)
|
||||
.cache
|
||||
|
||||
# next.js build output
|
||||
.next
|
||||
|
||||
# nuxt.js build output
|
||||
.nuxt
|
||||
|
||||
# react / gatsby
|
||||
public/
|
||||
|
||||
# vuepress build output
|
||||
.vuepress/dist
|
||||
|
||||
# Serverless directories
|
||||
.serverless/
|
||||
|
||||
# FuseBox cache
|
||||
.fusebox/
|
||||
|
||||
# DynamoDB Local files
|
||||
.dynamodb/
|
||||
|
||||
# End of https://www.gitignore.io/api/node
|
||||
9
build/actions/AutoLabel/action.yml
Normal file
9
build/actions/AutoLabel/action.yml
Normal file
@@ -0,0 +1,9 @@
|
||||
name: 'Auto Labeler'
|
||||
description: 'Automatically add a label to a PR'
|
||||
author: 'aaomidi'
|
||||
inputs:
|
||||
token:
|
||||
description: 'The GITHUB_TOKEN secret'
|
||||
runs:
|
||||
using: 'node12'
|
||||
main: 'dist/index.js'
|
||||
1
build/actions/AutoLabel/dist/index.d.ts
vendored
Normal file
1
build/actions/AutoLabel/dist/index.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
35714
build/actions/AutoLabel/dist/index.js
vendored
Normal file
35714
build/actions/AutoLabel/dist/index.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
24
build/actions/AutoLabel/package.json
Normal file
24
build/actions/AutoLabel/package.json
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "auto-merge",
|
||||
"version": "1.0.0",
|
||||
"main": "src/index.js",
|
||||
"repository": "git@github.com:aaomidi/AutoLabel.git",
|
||||
"author": "Amir Omidi <amir@aaomidi.com>",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"package": "ncc build src/index.ts -o dist",
|
||||
"lint": "eslint src/index.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^12.11.1",
|
||||
"@zeit/ncc": "^0.21.1",
|
||||
"eslint": "^6.8.0",
|
||||
"typescript": "^3.8.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.1.3",
|
||||
"@actions/github": "^1.1.0",
|
||||
"@octokit/rest": "^16.33.1",
|
||||
"actions-toolkit": "^3.0.1"
|
||||
}
|
||||
}
|
||||
37
build/actions/AutoLabel/src/index.ts
Normal file
37
build/actions/AutoLabel/src/index.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Toolkit } from 'actions-toolkit';
|
||||
|
||||
const tools = new Toolkit({
|
||||
event: 'pull_request',
|
||||
secrets: ['GITHUB_TOKEN']
|
||||
});
|
||||
|
||||
const label = tools.inputs.label || 'Port Request';
|
||||
|
||||
async function run() {
|
||||
try {
|
||||
let prNumber = tools.context.payload?.pull_request?.number;
|
||||
|
||||
if (prNumber === undefined) {
|
||||
console.error('PR Number was undefined');
|
||||
tools.log.error('PR Number was undefined');
|
||||
return;
|
||||
}
|
||||
|
||||
tools.github.issues.addLabels({
|
||||
...tools.context.repo,
|
||||
labels: [label],
|
||||
issue_number: prNumber
|
||||
});
|
||||
|
||||
} catch (ex) {
|
||||
console.error(ex);
|
||||
tools.log.error(ex);
|
||||
}
|
||||
}
|
||||
|
||||
run();
|
||||
76
build/actions/AutoLabel/tsconfig.json
Normal file
76
build/actions/AutoLabel/tsconfig.json
Normal file
@@ -0,0 +1,76 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
/* Basic Options */
|
||||
"target": "es6",
|
||||
/* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
|
||||
"module": "commonjs",
|
||||
/* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
|
||||
// "lib": [], /* Specify library files to be included in the compilation. */
|
||||
// "allowJs": true, /* Allow javascript files to be compiled. */
|
||||
// "checkJs": true, /* Report errors in .js files. */
|
||||
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
|
||||
"declaration": true,
|
||||
/* Generates corresponding '.d.ts' file. */
|
||||
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
|
||||
"sourceMap": true,
|
||||
/* Generates corresponding '.map' file. */
|
||||
// "outFile": "./", /* Concatenate and emit output to single file. */
|
||||
"outDir": "out",
|
||||
/* Redirect output structure to the directory. */
|
||||
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
||||
// "composite": true, /* Enable project compilation */
|
||||
// "removeComments": true, /* Do not emit comments to output. */
|
||||
// "noEmit": true, /* Do not emit outputs. */
|
||||
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
|
||||
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
|
||||
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
|
||||
|
||||
/* Strict Type-Checking Options */
|
||||
"strict": true,
|
||||
/* Enable all strict type-checking options. */
|
||||
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
|
||||
"strictNullChecks": true,
|
||||
/* Enable strict null checks. */
|
||||
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
|
||||
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
|
||||
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
|
||||
"alwaysStrict": true,
|
||||
/* Parse in strict mode and emit "use strict" for each source file. */
|
||||
|
||||
/* Additional Checks */
|
||||
// "noUnusedLocals": true, /* Report errors on unused locals. */
|
||||
// "noUnusedParameters": true, /* Report errors on unused parameters. */
|
||||
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
|
||||
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
|
||||
|
||||
/* Module Resolution Options */
|
||||
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
|
||||
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
|
||||
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
|
||||
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
|
||||
// "typeRoots": [], /* List of folders to include type definitions from. */
|
||||
"types": ["node"],
|
||||
"skipLibCheck": true,
|
||||
/* Type declaration files to be included in compilation. */
|
||||
"allowSyntheticDefaultImports": true,
|
||||
/* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
|
||||
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
|
||||
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
|
||||
|
||||
/* Source Map Options */
|
||||
// "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
|
||||
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
||||
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
|
||||
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
|
||||
|
||||
/* Experimental Options */
|
||||
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
|
||||
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
|
||||
},
|
||||
"include": [
|
||||
"./src/**/*.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
]
|
||||
}
|
||||
1405
build/actions/AutoLabel/yarn.lock
Normal file
1405
build/actions/AutoLabel/yarn.lock
Normal file
File diff suppressed because it is too large
Load Diff
17
build/actions/AutoMerge/.eslintrc.json
Normal file
17
build/actions/AutoMerge/.eslintrc.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"env": {
|
||||
"commonjs": true,
|
||||
"es6": true,
|
||||
"node": true
|
||||
},
|
||||
"extends": "eslint:recommended",
|
||||
"globals": {
|
||||
"Atomics": "readonly",
|
||||
"SharedArrayBuffer": "readonly"
|
||||
},
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2018
|
||||
},
|
||||
"rules": {
|
||||
}
|
||||
}
|
||||
100
build/actions/AutoMerge/.gitignore
vendored
Normal file
100
build/actions/AutoMerge/.gitignore
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
|
||||
# Created by https://www.gitignore.io/api/node
|
||||
# Edit at https://www.gitignore.io/?templates=node
|
||||
|
||||
### Node ###
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
lerna-debug.log*
|
||||
|
||||
# Diagnostic reports (https://nodejs.org/api/report.html)
|
||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
||||
|
||||
# Runtime data
|
||||
pids
|
||||
*.pid
|
||||
*.seed
|
||||
*.pid.lock
|
||||
|
||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
||||
lib-cov
|
||||
|
||||
# Coverage directory used by tools like istanbul
|
||||
coverage
|
||||
*.lcov
|
||||
|
||||
# nyc test coverage
|
||||
.nyc_output
|
||||
|
||||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
||||
.grunt
|
||||
|
||||
# Bower dependency directory (https://bower.io/)
|
||||
bower_components
|
||||
|
||||
# node-waf configuration
|
||||
.lock-wscript
|
||||
|
||||
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
||||
build/Release
|
||||
|
||||
# Dependency directories
|
||||
node_modules/
|
||||
jspm_packages/
|
||||
|
||||
# TypeScript v1 declaration files
|
||||
typings/
|
||||
|
||||
# TypeScript cache
|
||||
*.tsbuildinfo
|
||||
|
||||
# Optional npm cache directory
|
||||
.npm
|
||||
|
||||
# Optional eslint cache
|
||||
.eslintcache
|
||||
|
||||
# Optional REPL history
|
||||
.node_repl_history
|
||||
|
||||
# Output of 'npm pack'
|
||||
*.tgz
|
||||
|
||||
# Yarn Integrity file
|
||||
.yarn-integrity
|
||||
|
||||
# dotenv environment variables file
|
||||
.env
|
||||
.env.test
|
||||
|
||||
# parcel-bundler cache (https://parceljs.org/)
|
||||
.cache
|
||||
|
||||
# next.js build output
|
||||
.next
|
||||
|
||||
# nuxt.js build output
|
||||
.nuxt
|
||||
|
||||
# react / gatsby
|
||||
public/
|
||||
|
||||
# vuepress build output
|
||||
.vuepress/dist
|
||||
|
||||
# Serverless directories
|
||||
.serverless/
|
||||
|
||||
# FuseBox cache
|
||||
.fusebox/
|
||||
|
||||
# DynamoDB Local files
|
||||
.dynamodb/
|
||||
|
||||
# End of https://www.gitignore.io/api/node
|
||||
|
||||
out/
|
||||
6
build/actions/AutoMerge/action.yml
Normal file
6
build/actions/AutoMerge/action.yml
Normal file
@@ -0,0 +1,6 @@
|
||||
name: 'Auto Merge'
|
||||
description: 'Automatically merges a PR based on command'
|
||||
author: 'aaomidi'
|
||||
runs:
|
||||
using: 'node12'
|
||||
main: 'dist/index.js'
|
||||
1
build/actions/AutoMerge/dist/index.d.ts
vendored
Normal file
1
build/actions/AutoMerge/dist/index.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export {};
|
||||
35769
build/actions/AutoMerge/dist/index.js
vendored
Normal file
35769
build/actions/AutoMerge/dist/index.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
24
build/actions/AutoMerge/package.json
Normal file
24
build/actions/AutoMerge/package.json
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "auto-merge",
|
||||
"version": "1.0.0",
|
||||
"main": "src/index.js",
|
||||
"repository": "git@github.com:aaomidi/AutoMerge.git",
|
||||
"author": "Amir Omidi <amir@aaomidi.com>",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"package": "ncc build src/index.ts -o dist",
|
||||
"lint": "eslint src/index.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^12.11.1",
|
||||
"@zeit/ncc": "^0.21.1",
|
||||
"eslint": "^6.8.0",
|
||||
"typescript": "^3.8.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.1.3",
|
||||
"@actions/github": "^1.1.0",
|
||||
"@octokit/rest": "^16.33.1",
|
||||
"actions-toolkit": "^3.0.1"
|
||||
}
|
||||
}
|
||||
134
build/actions/AutoMerge/src/index.ts
Normal file
134
build/actions/AutoMerge/src/index.ts
Normal file
@@ -0,0 +1,134 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Toolkit } from 'actions-toolkit';
|
||||
import { Octokit } from '@octokit/rest';
|
||||
|
||||
interface LabelDefinition {
|
||||
id: number,
|
||||
name: string
|
||||
}
|
||||
|
||||
interface RepoContext {
|
||||
repo: string,
|
||||
owner: string
|
||||
}
|
||||
|
||||
const tools = new Toolkit({
|
||||
event: 'issue_comment',
|
||||
secrets: ['GITHUB_TOKEN']
|
||||
});
|
||||
|
||||
const labelToCheckFor = tools.inputs.label || 'Approved';
|
||||
|
||||
const fileToCheckFor = tools.inputs.filePath || './.github/mergers.json';
|
||||
|
||||
const checkMerged = async (repoContext: RepoContext, pullNumber: number): Promise<boolean> => {
|
||||
let isMerged: boolean;
|
||||
try {
|
||||
const result = await tools.github.pulls.checkIfMerged({
|
||||
...repoContext,
|
||||
pull_number: pullNumber
|
||||
});
|
||||
isMerged = result.status === 204;
|
||||
} catch (ex) {
|
||||
isMerged = false;
|
||||
}
|
||||
return isMerged;
|
||||
};
|
||||
|
||||
const checkCollabrator = async (repoContext: RepoContext, username: string): Promise<boolean> => {
|
||||
let isCollabrator: boolean;
|
||||
try {
|
||||
const result = await tools.github.repos.checkCollaborator({
|
||||
...repoContext,
|
||||
username,
|
||||
});
|
||||
isCollabrator = result.status === 204;
|
||||
} catch (ex) {
|
||||
isCollabrator = false;
|
||||
}
|
||||
return isCollabrator;
|
||||
};
|
||||
|
||||
tools.command('merge', async () => {
|
||||
try {
|
||||
const issue = tools.context.payload.issue;
|
||||
|
||||
if (issue?.pull_request === undefined) {
|
||||
console.log('This command only works on pull requests');
|
||||
return;
|
||||
}
|
||||
|
||||
const sender = tools.context.payload.sender;
|
||||
|
||||
const senderName = sender?.login ?? ' Unknown Sender';
|
||||
const issueNumber = issue?.number;
|
||||
|
||||
if (!issueNumber) {
|
||||
return tools.log.error('Issue number not defined.');
|
||||
}
|
||||
|
||||
const isMerged = await checkMerged(tools.context.repo, issueNumber);
|
||||
|
||||
if (isMerged === true) {
|
||||
console.log('PR is already merged');
|
||||
return;
|
||||
}
|
||||
|
||||
const mergers: string[] = JSON.parse(tools.getFile(fileToCheckFor));
|
||||
|
||||
if (!mergers.includes(senderName)) {
|
||||
console.log('Unrecognized user tried to merge!', senderName);
|
||||
return;
|
||||
}
|
||||
|
||||
const isCollabrator = await checkCollabrator(tools.context.repo, senderName);
|
||||
|
||||
if (isCollabrator !== true) {
|
||||
console.log('User is not a collabrator');
|
||||
return;
|
||||
}
|
||||
|
||||
const labels: LabelDefinition[] = issue.labels || [];
|
||||
|
||||
const foundLabel = labels.find(l => l.name === labelToCheckFor);
|
||||
|
||||
if (foundLabel === undefined) {
|
||||
console.log(`Label ${labelToCheckFor} must be applied`);
|
||||
const createCommentParams: Octokit.IssuesCreateCommentParams = {
|
||||
...tools.context.repo,
|
||||
issue_number: issueNumber,
|
||||
body: `The label ${labelToCheckFor} is required for using this command.`
|
||||
};
|
||||
await tools.github.issues.createComment(createCommentParams);
|
||||
return;
|
||||
}
|
||||
|
||||
const createCommentParams: Octokit.IssuesCreateCommentParams = {
|
||||
...tools.context.repo,
|
||||
issue_number: issueNumber,
|
||||
body: `Merging PR based on approval from @${senderName}`
|
||||
};
|
||||
|
||||
const commentResult = await tools.github.issues.createComment(createCommentParams);
|
||||
|
||||
if (commentResult.status !== 201) {
|
||||
console.log('Comment not created');
|
||||
return;
|
||||
}
|
||||
|
||||
const mergeResult = await tools.github.pulls.merge({
|
||||
...tools.context.repo,
|
||||
pull_number: issueNumber,
|
||||
merge_method: 'squash'
|
||||
});
|
||||
console.log(mergeResult);
|
||||
} catch (ex) {
|
||||
console.error(ex);
|
||||
}
|
||||
});
|
||||
|
||||
console.log('Running...');
|
||||
76
build/actions/AutoMerge/tsconfig.json
Normal file
76
build/actions/AutoMerge/tsconfig.json
Normal file
@@ -0,0 +1,76 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
/* Basic Options */
|
||||
"target": "es6",
|
||||
/* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
|
||||
"module": "commonjs",
|
||||
/* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
|
||||
// "lib": [], /* Specify library files to be included in the compilation. */
|
||||
// "allowJs": true, /* Allow javascript files to be compiled. */
|
||||
// "checkJs": true, /* Report errors in .js files. */
|
||||
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
|
||||
"declaration": true,
|
||||
/* Generates corresponding '.d.ts' file. */
|
||||
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
|
||||
"sourceMap": true,
|
||||
/* Generates corresponding '.map' file. */
|
||||
// "outFile": "./", /* Concatenate and emit output to single file. */
|
||||
"outDir": "out",
|
||||
/* Redirect output structure to the directory. */
|
||||
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
||||
// "composite": true, /* Enable project compilation */
|
||||
// "removeComments": true, /* Do not emit comments to output. */
|
||||
// "noEmit": true, /* Do not emit outputs. */
|
||||
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
|
||||
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
|
||||
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
|
||||
|
||||
/* Strict Type-Checking Options */
|
||||
"strict": true,
|
||||
/* Enable all strict type-checking options. */
|
||||
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
|
||||
"strictNullChecks": true,
|
||||
/* Enable strict null checks. */
|
||||
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
|
||||
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
|
||||
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
|
||||
"alwaysStrict": true,
|
||||
/* Parse in strict mode and emit "use strict" for each source file. */
|
||||
|
||||
/* Additional Checks */
|
||||
// "noUnusedLocals": true, /* Report errors on unused locals. */
|
||||
// "noUnusedParameters": true, /* Report errors on unused parameters. */
|
||||
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
|
||||
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
|
||||
|
||||
/* Module Resolution Options */
|
||||
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
|
||||
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
|
||||
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
|
||||
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
|
||||
// "typeRoots": [], /* List of folders to include type definitions from. */
|
||||
"types": ["node"],
|
||||
"skipLibCheck": true,
|
||||
/* Type declaration files to be included in compilation. */
|
||||
"allowSyntheticDefaultImports": true,
|
||||
/* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
|
||||
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
|
||||
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
|
||||
|
||||
/* Source Map Options */
|
||||
// "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
|
||||
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
||||
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
|
||||
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
|
||||
|
||||
/* Experimental Options */
|
||||
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
|
||||
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
|
||||
},
|
||||
"include": [
|
||||
"./src/**/*.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
]
|
||||
}
|
||||
1405
build/actions/AutoMerge/yarn.lock
Normal file
1405
build/actions/AutoMerge/yarn.lock
Normal file
File diff suppressed because it is too large
Load Diff
@@ -44,15 +44,16 @@ async function doesAssetExist(blobService: azure.BlobService, quality: string, b
|
||||
return existsResult.exists;
|
||||
}
|
||||
|
||||
async function uploadBlob(blobService: azure.BlobService, quality: string, blobName: string, file: string): Promise<void> {
|
||||
async function uploadBlob(blobService: azure.BlobService, quality: string, blobName: string, filePath: string, fileName: string): Promise<void> {
|
||||
const blobOptions: azure.BlobService.CreateBlockBlobRequestOptions = {
|
||||
contentSettings: {
|
||||
contentType: mime.lookup(file),
|
||||
contentType: mime.lookup(filePath),
|
||||
contentDisposition: `attachment; filename="${fileName}"`,
|
||||
cacheControl: 'max-age=31536000, public'
|
||||
}
|
||||
};
|
||||
|
||||
await new Promise((c, e) => blobService.createBlockBlobFromLocalFile(quality, blobName, file, blobOptions, err => err ? e(err) : c()));
|
||||
await new Promise((c, e) => blobService.createBlockBlobFromLocalFile(quality, blobName, filePath, blobOptions, err => err ? e(err) : c()));
|
||||
}
|
||||
|
||||
function getEnv(name: string): string {
|
||||
@@ -66,24 +67,24 @@ function getEnv(name: string): string {
|
||||
}
|
||||
|
||||
async function main(): Promise<void> {
|
||||
const [, , platform, type, name, file] = process.argv;
|
||||
const [, , platform, type, fileName, filePath] = process.argv;
|
||||
const quality = getEnv('VSCODE_QUALITY');
|
||||
const commit = getEnv('BUILD_SOURCEVERSION');
|
||||
|
||||
console.log('Creating asset...');
|
||||
|
||||
const stat = await new Promise<fs.Stats>((c, e) => fs.stat(file, (err, stat) => err ? e(err) : c(stat)));
|
||||
const stat = await new Promise<fs.Stats>((c, e) => fs.stat(filePath, (err, stat) => err ? e(err) : c(stat)));
|
||||
const size = stat.size;
|
||||
|
||||
console.log('Size:', size);
|
||||
|
||||
const stream = fs.createReadStream(file);
|
||||
const stream = fs.createReadStream(filePath);
|
||||
const [sha1hash, sha256hash] = await Promise.all([hashStream('sha1', stream), hashStream('sha256', stream)]);
|
||||
|
||||
console.log('SHA1:', sha1hash);
|
||||
console.log('SHA256:', sha256hash);
|
||||
|
||||
const blobName = commit + '/' + name;
|
||||
const blobName = commit + '/' + fileName;
|
||||
const storageAccount = process.env['AZURE_STORAGE_ACCOUNT_2']!;
|
||||
|
||||
const blobService = azure.createBlobService(storageAccount, process.env['AZURE_STORAGE_ACCESS_KEY_2']!)
|
||||
@@ -98,7 +99,7 @@ async function main(): Promise<void> {
|
||||
|
||||
console.log('Uploading blobs to Azure storage...');
|
||||
|
||||
await uploadBlob(blobService, quality, blobName, file);
|
||||
await uploadBlob(blobService, quality, blobName, filePath, fileName);
|
||||
|
||||
console.log('Blobs successfully uploaded.');
|
||||
|
||||
|
||||
@@ -24,20 +24,17 @@ steps:
|
||||
yarn electron x64
|
||||
displayName: Download Electron
|
||||
- script: |
|
||||
yarn gulp hygiene --skip-tslint
|
||||
yarn gulp hygiene
|
||||
displayName: Run Hygiene Checks
|
||||
- script: |
|
||||
yarn gulp tslint
|
||||
displayName: Run TSLint Checks
|
||||
- script: | # {{SQL CARBON EDIT}} add step
|
||||
yarn strict-null-check
|
||||
yarn strict-vscode
|
||||
displayName: Run Strict Null Check.
|
||||
- script: | # {{SQL CARBON EDIT}} add step
|
||||
yarn tslint
|
||||
displayName: Run TSLint (gci)
|
||||
# - script: | {{SQL CARBON EDIT}} remove step
|
||||
# yarn monaco-compile-check
|
||||
# displayName: Run Monaco Editor Checks
|
||||
- script: |
|
||||
yarn valid-layers-check
|
||||
displayName: Run Valid Layers Checks
|
||||
- script: |
|
||||
yarn compile
|
||||
displayName: Compile Sources
|
||||
@@ -46,10 +43,13 @@ steps:
|
||||
# displayName: Download Built-in Extensions
|
||||
- script: |
|
||||
./scripts/test.sh --tfs "Unit Tests"
|
||||
displayName: Run Unit Tests
|
||||
displayName: Run Unit Tests (Electron)
|
||||
# - script: | {{SQL CARBON EDIT}} disable for now @TODO @anthonydresser
|
||||
# yarn test-browser --browser chromium --browser webkit
|
||||
# displayName: Run Unit Tests (Browser)
|
||||
# - script: | {{SQL CARBON EDIT}} remove step
|
||||
# ./scripts/test-integration.sh --tfs "Integration Tests"
|
||||
# displayName: Run Integration Tests
|
||||
# displayName: Run Integration Tests (Electron)
|
||||
- task: PublishTestResults@2
|
||||
displayName: Publish Tests Results
|
||||
inputs:
|
||||
|
||||
@@ -5,9 +5,6 @@ REPO="$(pwd)"
|
||||
# ensure drop directories exist
|
||||
mkdir -p $REPO/.build/darwin/{archive,server}
|
||||
|
||||
# remove pkg from archive
|
||||
zip -d $REPO/.build/darwin/archive/azuredatastudio-darwin.zip "*.pkg"
|
||||
|
||||
# package Remote Extension Host
|
||||
pushd .. && mv azuredatastudio-reh-darwin azuredatastudio-server-darwin && zip -Xry $REPO/.build/darwin/server/azuredatastudio-server-darwin.zip azuredatastudio-server-darwin && popd
|
||||
|
||||
|
||||
14
build/azure-pipelines/darwin/entitlements.plist
Normal file
14
build/azure-pipelines/darwin/entitlements.plist
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.security.cs.allow-jit</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.disable-library-validation</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
22
build/azure-pipelines/darwin/entitlements.xml
Normal file
22
build/azure-pipelines/darwin/entitlements.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.security.cs.allow-jit</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.disable-executable-page-protection</key>
|
||||
<true/>
|
||||
<key>com.apple.security.cs.disable-library-validation</key>
|
||||
<true/>
|
||||
<key>com.apple.security.network.client</key>
|
||||
<true/>
|
||||
<key>com.apple.security.network.server</key>
|
||||
<true/>
|
||||
<key>com.apple.security.app-sandbox</key>
|
||||
<false/>
|
||||
<key>com.apple.security.automation.apple-events</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -96,9 +96,13 @@ steps:
|
||||
- script: |
|
||||
set -e
|
||||
./scripts/test.sh --build --tfs "Unit Tests"
|
||||
# APP_NAME="`ls $(agent.builddirectory)/VSCode-darwin | head -n 1`"
|
||||
# yarn smoketest -- --build "$(agent.builddirectory)/VSCode-darwin/$APP_NAME"
|
||||
displayName: Run unit tests
|
||||
displayName: Run unit tests (Electron)
|
||||
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
yarn test-browser --build --browser chromium --browser webkit
|
||||
displayName: Run unit tests (Browser)
|
||||
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
||||
|
||||
- script: |
|
||||
@@ -111,33 +115,40 @@ steps:
|
||||
INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME/Contents/MacOS/Electron" \
|
||||
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-darwin" \
|
||||
./scripts/test-integration.sh --build --tfs "Integration Tests"
|
||||
displayName: Run integration tests
|
||||
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
||||
|
||||
# Web Smoke Tests disabled due to https://github.com/microsoft/vscode/issues/80308
|
||||
# - script: |
|
||||
# set -e
|
||||
# cd test/smoke
|
||||
# yarn compile
|
||||
# cd -
|
||||
# yarn smoketest --web --headless
|
||||
# continueOnError: true
|
||||
# displayName: Run web smoke tests
|
||||
# condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
cd test/smoke
|
||||
yarn compile
|
||||
cd -
|
||||
yarn smoketest --web --headless
|
||||
continueOnError: true
|
||||
displayName: Run smoke tests
|
||||
displayName: Run integration tests (Electron)
|
||||
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
pushd ../VSCode-darwin && zip -r -X -y ../VSCode-darwin.zip * && popd
|
||||
APP_ROOT=$(agent.builddirectory)/VSCode-darwin
|
||||
APP_NAME="`ls $APP_ROOT | head -n 1`"
|
||||
INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME/Contents/MacOS/Electron" \
|
||||
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-darwin" \
|
||||
./resources/server/test/test-remote-integration.sh
|
||||
displayName: Run remote integration tests (Electron)
|
||||
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-web-darwin" \
|
||||
./resources/server/test/test-web-integration.sh --browser webkit
|
||||
displayName: Run integration tests (Browser)
|
||||
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
security create-keychain -p pwd $(agent.tempdirectory)/buildagent.keychain
|
||||
security default-keychain -s $(agent.tempdirectory)/buildagent.keychain
|
||||
security unlock-keychain -p pwd $(agent.tempdirectory)/buildagent.keychain
|
||||
echo "$(macos-developer-certificate)" | base64 -D > $(agent.tempdirectory)/cert.p12
|
||||
security import $(agent.tempdirectory)/cert.p12 -k $(agent.tempdirectory)/buildagent.keychain -P "$(macos-developer-certificate-key)" -T /usr/bin/codesign
|
||||
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k pwd $(agent.tempdirectory)/buildagent.keychain
|
||||
codesign -s 99FM488X57 --deep --force --options runtime --entitlements build/azure-pipelines/darwin/entitlements.plist $(agent.builddirectory)/VSCode-darwin/*.app
|
||||
displayName: Set Hardened Entitlements
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
pushd $(agent.builddirectory)/VSCode-darwin && zip -r -X -y $(agent.builddirectory)/VSCode-darwin.zip * && popd
|
||||
displayName: Archive build
|
||||
|
||||
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
|
||||
@@ -151,14 +162,54 @@ steps:
|
||||
{
|
||||
"keyCode": "CP-401337-Apple",
|
||||
"operationSetCode": "MacAppDeveloperSign",
|
||||
"parameters": [ ],
|
||||
"parameters": [
|
||||
{
|
||||
"parameterName": "Hardening",
|
||||
"parameterValue": "--options=runtime"
|
||||
}
|
||||
],
|
||||
"toolName": "sign",
|
||||
"toolVersion": "1.0"
|
||||
}
|
||||
]
|
||||
SessionTimeout: 120
|
||||
SessionTimeout: 60
|
||||
displayName: Codesign
|
||||
|
||||
- script: |
|
||||
zip -d $(agent.builddirectory)/VSCode-darwin.zip "*.pkg"
|
||||
displayName: Clean Archive
|
||||
|
||||
- script: |
|
||||
APP_ROOT=$(agent.builddirectory)/VSCode-darwin
|
||||
APP_NAME="`ls $APP_ROOT | head -n 1`"
|
||||
BUNDLE_IDENTIFIER=$(node -p "require(\"$APP_ROOT/$APP_NAME/Contents/Resources/app/product.json\").darwinBundleIdentifier")
|
||||
echo "##vso[task.setvariable variable=BundleIdentifier]$BUNDLE_IDENTIFIER"
|
||||
displayName: Export bundle identifier
|
||||
|
||||
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
|
||||
inputs:
|
||||
ConnectedServiceName: 'ESRP CodeSign'
|
||||
FolderPath: '$(agent.builddirectory)'
|
||||
Pattern: 'VSCode-darwin.zip'
|
||||
signConfigType: inlineSignParams
|
||||
inlineOperation: |
|
||||
[
|
||||
{
|
||||
"keyCode": "CP-401337-Apple",
|
||||
"operationSetCode": "MacAppNotarize",
|
||||
"parameters": [
|
||||
{
|
||||
"parameterName": "BundleId",
|
||||
"parameterValue": "$(BundleIdentifier)"
|
||||
}
|
||||
],
|
||||
"toolName": "sign",
|
||||
"toolVersion": "1.0"
|
||||
}
|
||||
]
|
||||
SessionTimeout: 60
|
||||
displayName: Notarization
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
# remove pkg from archive
|
||||
zip -d ../VSCode-darwin.zip "*.pkg"
|
||||
|
||||
# publish the build
|
||||
node build/azure-pipelines/common/createAsset.js \
|
||||
darwin \
|
||||
@@ -22,7 +19,9 @@ node build/azure-pipelines/common/createAsset.js \
|
||||
../vscode-server-darwin.zip
|
||||
|
||||
# publish hockeyapp symbols
|
||||
node build/azure-pipelines/common/symbols.js "$VSCODE_MIXIN_PASSWORD" "$VSCODE_HOCKEYAPP_TOKEN" x64 "$VSCODE_HOCKEYAPP_ID_MACOS"
|
||||
# node build/azure-pipelines/common/symbols.js "$VSCODE_MIXIN_PASSWORD" "$VSCODE_HOCKEYAPP_TOKEN" x64 "$VSCODE_HOCKEYAPP_ID_MACOS"
|
||||
# Skip hockey app because build failure.
|
||||
# https://github.com/microsoft/vscode/issues/90491
|
||||
|
||||
# upload configuration
|
||||
yarn gulp upload-vscode-configuration
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
steps:
|
||||
- task: InstallAppleCertificate@2
|
||||
displayName: 'Install developer certificate'
|
||||
inputs:
|
||||
certSecureFile: 'osx_signing_key.p12'
|
||||
condition: eq(variables['signed'], true)
|
||||
|
||||
- script: |
|
||||
mkdir -p .build
|
||||
echo -n $BUILD_SOURCEVERSION > .build/commit
|
||||
@@ -64,6 +70,8 @@ steps:
|
||||
set -e
|
||||
CHILD_CONCURRENCY=1 yarn --frozen-lockfile
|
||||
displayName: Install dependencies
|
||||
env:
|
||||
GITHUB_TOKEN: $(github-distro-mixin-password)
|
||||
condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
|
||||
|
||||
- task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
|
||||
@@ -105,12 +113,49 @@ steps:
|
||||
displayName: Run unit tests
|
||||
condition: and(succeeded(), eq(variables['RUN_TESTS'], 'true'))
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
pushd ../azuredatastudio-darwin
|
||||
ls
|
||||
|
||||
echo "Cleaning the application"
|
||||
xattr -cr *.app
|
||||
cd *.app
|
||||
find . -name '._*' -print0 | xargs -0 rm -rf --
|
||||
cd ..
|
||||
|
||||
echo "Signing the application with deep"
|
||||
codesign --deep --force --timestamp --options runtime --entitlements $(Build.SourcesDirectory)/build/azure-pipelines/darwin/entitlements.xml -s LPV3BJJYXS *.app
|
||||
|
||||
cd *.app
|
||||
ls
|
||||
echo "Signing specific components"
|
||||
find . -type f -print0 | xargs -0 file | grep ': *Mach-O' | sed 's/: *Mach-O.*//' | while read -r file; do codesign --options runtime --timestamp --entitlements $(Build.SourcesDirectory)/build/azure-pipelines/darwin/entitlements.xml -s LPV3BJJYXS --force "$file" || break; done
|
||||
|
||||
echo "Signing Electron again..."
|
||||
codesign --force --timestamp --options runtime --entitlements $(Build.SourcesDirectory)/build/azure-pipelines/darwin/entitlements.xml -s LPV3BJJYXS Contents/Frameworks/Electron\ Framework.framework
|
||||
cd ..
|
||||
|
||||
echo "Signing the entire application one more time"
|
||||
codesign --force --timestamp --options runtime --entitlements $(Build.SourcesDirectory)/build/azure-pipelines/darwin/entitlements.xml -s LPV3BJJYXS *.app
|
||||
popd
|
||||
displayName: 'Manual codesign'
|
||||
condition: and(succeeded(), eq(variables['signed'], true))
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
mkdir -p .build/darwin/archive
|
||||
pushd ../azuredatastudio-darwin && zip -r -X -y $(Build.SourcesDirectory)/.build/darwin/archive/azuredatastudio-darwin.zip * && popd
|
||||
pushd ../azuredatastudio-darwin
|
||||
ditto -c -k --keepParent *.app $(Build.SourcesDirectory)/.build/darwin/archive/azuredatastudio-darwin.zip
|
||||
popd
|
||||
displayName: 'Archive'
|
||||
|
||||
- task: PublishPipelineArtifact@0
|
||||
displayName: 'Publish SelfSigned'
|
||||
inputs:
|
||||
artifactName: darwin-selfsigned
|
||||
targetPath: $(Build.SourcesDirectory)/.build/darwin/archive/azuredatastudio-darwin.zip
|
||||
|
||||
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
|
||||
displayName: 'ESRP CodeSigning'
|
||||
inputs:
|
||||
@@ -122,13 +167,57 @@ steps:
|
||||
[
|
||||
{
|
||||
"keyCode": "CP-401337-Apple",
|
||||
"operationSetCode": "MacAppDeveloperSign",
|
||||
"parameters": [],
|
||||
"operationCode": "MacAppDeveloperSign",
|
||||
"parameters": {
|
||||
"Hardening": "Enable"
|
||||
},
|
||||
"toolName": "sign",
|
||||
"toolVersion": "1.0"
|
||||
}
|
||||
]
|
||||
SessionTimeout: 20
|
||||
SessionTimeout: 90
|
||||
condition: and(succeeded(), eq(variables['signed'], true))
|
||||
|
||||
- script: |
|
||||
zip -d $(Build.SourcesDirectory)/.build/darwin/archive/azuredatastudio-darwin.zip "*.pkg"
|
||||
displayName: Clean Archive
|
||||
condition: and(succeeded(), eq(variables['signed'], true))
|
||||
|
||||
- task: PublishPipelineArtifact@0
|
||||
displayName: 'Publish Signed'
|
||||
inputs:
|
||||
artifactName: darwin-signed
|
||||
targetPath: $(Build.SourcesDirectory)/.build/darwin/archive/azuredatastudio-darwin.zip
|
||||
condition: and(succeeded(), eq(variables['signed'], true))
|
||||
|
||||
- task: EsrpCodeSigning@1
|
||||
displayName: 'ESRP Notarization'
|
||||
inputs:
|
||||
ConnectedServiceName: 'Code Signing'
|
||||
FolderPath: '$(Build.SourcesDirectory)/.build/darwin/archive'
|
||||
Pattern: 'azuredatastudio-darwin.zip'
|
||||
signConfigType: inlineSignParams
|
||||
inlineOperation: |
|
||||
[
|
||||
{
|
||||
"KeyCode": "CP-401337-Apple",
|
||||
"OperationCode": "MacAppNotarize",
|
||||
"Parameters": {
|
||||
"BundleId": "com.microsoft.azuredatastudio-$(VSCODE_QUALITY)"
|
||||
},
|
||||
"ToolName": "sign",
|
||||
"ToolVersion": "1.0"
|
||||
}
|
||||
]
|
||||
SessionTimeout: 120
|
||||
condition: and(succeeded(), eq(variables['signed'], true))
|
||||
|
||||
- task: PublishPipelineArtifact@0
|
||||
displayName: 'Publish Notarized'
|
||||
inputs:
|
||||
artifactName: darwin-notarized
|
||||
targetPath: $(Build.SourcesDirectory)/.build/darwin/archive/azuredatastudio-darwin.zip
|
||||
condition: and(succeeded(), eq(variables['signed'], true))
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
@@ -146,14 +235,6 @@ steps:
|
||||
continueOnError: true
|
||||
condition: and(succeeded(), eq(variables['RUN_TESTS'], 'true'))
|
||||
|
||||
- task: PublishTestResults@2
|
||||
displayName: 'Publish Integration and Smoke Test Results'
|
||||
inputs:
|
||||
testResultsFiles: 'dawin-integration-tests-results.xml'
|
||||
searchFolder: '$(Build.ArtifactStagingDirectory)\test-results'
|
||||
continueOnError: true
|
||||
condition: and(succeeded(), eq(variables['RUN_TESTS'], 'true'))
|
||||
|
||||
- task: PublishCodeCoverageResults@1
|
||||
displayName: 'Publish code coverage from $(Build.SourcesDirectory)/.build/coverage/cobertura-coverage.xml'
|
||||
inputs:
|
||||
|
||||
@@ -2,11 +2,16 @@
|
||||
FROM ubuntu:16.04
|
||||
|
||||
# Update Software repository
|
||||
RUN apt-get update --fix-missing
|
||||
RUN apt-get update && apt-get upgrade -y
|
||||
|
||||
RUN apt-get install -y libxkbfile-dev pkg-config libsecret-1-dev libxss1 dbus xvfb libgtk-3-0 \
|
||||
libkrb5-dev git apt-transport-https ca-certificates curl gnupg-agent software-properties-common \
|
||||
libnss3 libasound2 make gcc libx11-dev fakeroot rpm
|
||||
libnss3 libasound2 make gcc libx11-dev fakeroot rpm libgconf-2-4 libunwind8 g++-4.8
|
||||
|
||||
RUN rm /usr/bin/gcc
|
||||
RUN rm /usr/bin/g++
|
||||
RUN ln -s /usr/bin/gcc-4.8 /usr/bin/gcc
|
||||
RUN ln -s /usr/bin/g++-4.8 /usr/bin/g++
|
||||
|
||||
#docker
|
||||
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
|
||||
@@ -15,6 +20,8 @@ RUN add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubunt
|
||||
RUN apt-get update
|
||||
RUN apt-get -y install docker-ce docker-ce-cli containerd.io
|
||||
|
||||
# This image needs to be built on a linux host; some weird stuff happens and the xvfb service won't start
|
||||
# if built on a windows host.
|
||||
ADD ./xvfb.init /etc/init.d/xvfb
|
||||
RUN chmod +x /etc/init.d/xvfb
|
||||
RUN update-rc.d xvfb defaults
|
||||
|
||||
@@ -32,20 +32,17 @@ steps:
|
||||
yarn electron x64
|
||||
displayName: Download Electron
|
||||
- script: |
|
||||
yarn gulp hygiene --skip-tslint
|
||||
yarn gulp hygiene
|
||||
displayName: Run Hygiene Checks
|
||||
- script: |
|
||||
yarn gulp tslint
|
||||
displayName: Run TSLint Checks
|
||||
- script: | # {{SQL CARBON EDIT}} add gci checks
|
||||
yarn tslint
|
||||
displayName: Run TSLint (gci)
|
||||
- script: | # {{SQL CARBON EDIT}} add strict null check
|
||||
yarn strict-null-check
|
||||
yarn strict-vscode
|
||||
displayName: Run Strict Null Check
|
||||
# - script: | {{SQL CARBON EDIT}} remove monaco editor checks
|
||||
# yarn monaco-compile-check
|
||||
# displayName: Run Monaco Editor Checks
|
||||
- script: |
|
||||
yarn valid-layers-check
|
||||
displayName: Run Valid Layers Checks
|
||||
- script: |
|
||||
yarn compile
|
||||
displayName: Compile Sources
|
||||
@@ -54,10 +51,13 @@ steps:
|
||||
# displayName: Download Built-in Extensions
|
||||
- script: |
|
||||
DISPLAY=:10 ./scripts/test.sh --tfs "Unit Tests"
|
||||
displayName: Run Unit Tests
|
||||
displayName: Run Unit Tests (Electron)
|
||||
# - script: | {{SQL CARBON EDIT}} disable for now @TODO @anthonydresser
|
||||
# DISPLAY=:10 yarn test-browser --browser chromium
|
||||
# displayName: Run Unit Tests (Browser)
|
||||
# - script: | {{SQL CARBON EDIT}} remove step
|
||||
# DISPLAY=:10 ./scripts/test-integration.sh --tfs "Integration Tests"
|
||||
# displayName: Run Integration Tests
|
||||
# displayName: Run Integration Tests (Electron)
|
||||
- task: PublishTestResults@2
|
||||
displayName: Publish Tests Results
|
||||
inputs:
|
||||
|
||||
@@ -101,7 +101,13 @@ steps:
|
||||
- script: |
|
||||
set -e
|
||||
DISPLAY=:10 ./scripts/test.sh --build --tfs "Unit Tests"
|
||||
displayName: Run unit tests
|
||||
displayName: Run unit tests (Electron)
|
||||
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
DISPLAY=:10 yarn test-browser --build --browser chromium
|
||||
displayName: Run unit tests (Browser)
|
||||
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
||||
|
||||
- script: |
|
||||
@@ -114,8 +120,24 @@ steps:
|
||||
INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME" \
|
||||
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-linux-x64" \
|
||||
DISPLAY=:10 ./scripts/test-integration.sh --build --tfs "Integration Tests"
|
||||
# yarn smoketest -- --build "$(agent.builddirectory)/VSCode-linux-x64"
|
||||
displayName: Run integration tests
|
||||
displayName: Run integration tests (Electron)
|
||||
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
APP_ROOT=$(agent.builddirectory)/VSCode-linux-x64
|
||||
APP_NAME=$(node -p "require(\"$APP_ROOT/resources/app/product.json\").applicationName")
|
||||
INTEGRATION_TEST_ELECTRON_PATH="$APP_ROOT/$APP_NAME" \
|
||||
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-linux-x64" \
|
||||
DISPLAY=:10 ./resources/server/test/test-remote-integration.sh
|
||||
displayName: Run remote integration tests (Electron)
|
||||
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
VSCODE_REMOTE_SERVER_PATH="$(agent.builddirectory)/vscode-reh-web-linux-x64" \
|
||||
DISPLAY=:10 ./resources/server/test/test-web-integration.sh --browser chromium
|
||||
displayName: Run integration tests (Browser)
|
||||
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
||||
|
||||
- script: |
|
||||
|
||||
@@ -28,7 +28,9 @@ rm -rf $ROOT/vscode-server-*.tar.*
|
||||
node build/azure-pipelines/common/createAsset.js "server-$PLATFORM_LINUX" archive-unsigned "$SERVER_TARBALL_FILENAME" "$SERVER_TARBALL_PATH"
|
||||
|
||||
# Publish hockeyapp symbols
|
||||
node build/azure-pipelines/common/symbols.js "$VSCODE_MIXIN_PASSWORD" "$VSCODE_HOCKEYAPP_TOKEN" "x64" "$VSCODE_HOCKEYAPP_ID_LINUX64"
|
||||
# node build/azure-pipelines/common/symbols.js "$VSCODE_MIXIN_PASSWORD" "$VSCODE_HOCKEYAPP_TOKEN" "x64" "$VSCODE_HOCKEYAPP_ID_LINUX64"
|
||||
# Skip hockey app because build failure.
|
||||
# https://github.com/microsoft/vscode/issues/90491
|
||||
|
||||
# Publish DEB
|
||||
PLATFORM_DEB="linux-deb-x64"
|
||||
|
||||
@@ -63,6 +63,8 @@ steps:
|
||||
set -e
|
||||
CHILD_CONCURRENCY=1 yarn --frozen-lockfile
|
||||
displayName: Install dependencies
|
||||
env:
|
||||
GITHUB_TOKEN: $(github-distro-mixin-password)
|
||||
condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
|
||||
|
||||
- task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
|
||||
@@ -145,24 +147,23 @@ steps:
|
||||
./build/azure-pipelines/linux/createDrop.sh
|
||||
displayName: Create Drop
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: 'Publish Artifact: drop'
|
||||
- task: CopyFiles@2
|
||||
displayName: 'Copy Extension Unit Test Coverage Files to: $(Build.ArtifactStagingDirectory)'
|
||||
inputs:
|
||||
SourceFolder: '$(Build.SourcesDirectory)/extensions'
|
||||
Contents: '*/coverage/**'
|
||||
TargetFolder: '$(Build.ArtifactStagingDirectory)/test-results/coverage'
|
||||
|
||||
- task: PublishTestResults@2
|
||||
displayName: 'Publish Test Results test-results.xml'
|
||||
inputs:
|
||||
testResultsFiles: 'test-results.xml'
|
||||
searchFolder: '$(Build.SourcesDirectory)'
|
||||
testResultsFiles: '*.xml'
|
||||
searchFolder: '$(Build.ArtifactStagingDirectory)/test-results'
|
||||
continueOnError: true
|
||||
condition: and(succeeded(), eq(variables['RUN_TESTS'], 'true'))
|
||||
|
||||
- task: PublishCodeCoverageResults@1
|
||||
displayName: 'Publish code coverage from $(Build.SourcesDirectory)/.build/coverage/cobertura-coverage.xml'
|
||||
inputs:
|
||||
codeCoverageTool: Cobertura
|
||||
summaryFileLocation: '$(Build.SourcesDirectory)/.build/coverage/cobertura-coverage.xml'
|
||||
reportDirectory: '$(Build.SourcesDirectory)/.build/coverage'
|
||||
continueOnError: true
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: 'Publish Artifact: drop'
|
||||
|
||||
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
|
||||
displayName: 'Component Detection'
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
[ "${NETWORKING}" = "no" ] && exit 0
|
||||
|
||||
PROG="/usr/bin/Xvfb"
|
||||
PROG_OPTIONS=":10 -ac"
|
||||
PROG_OPTIONS=":10 -ac -screen 0 1024x768x24"
|
||||
PROG_OUTPUT="/tmp/Xvfb.out"
|
||||
|
||||
case "$1" in
|
||||
@@ -50,4 +50,4 @@ case "$1" in
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit $RETVAL
|
||||
exit $RETVAL
|
||||
|
||||
@@ -102,7 +102,7 @@ jobs:
|
||||
- job: macOS
|
||||
condition: and(succeeded(), eq(variables['VSCODE_COMPILE_ONLY'], 'false'), eq(variables['VSCODE_BUILD_MACOS'], 'true'))
|
||||
pool:
|
||||
vmImage: macOS 10.13
|
||||
vmImage: macOS-latest
|
||||
dependsOn:
|
||||
- Compile
|
||||
steps:
|
||||
|
||||
@@ -77,6 +77,21 @@ steps:
|
||||
yarn postinstall
|
||||
displayName: Run postinstall scripts
|
||||
condition: and(succeeded(), ne(variables['CacheExists-Compilation'], 'true'), eq(variables['CacheRestored'], 'true'))
|
||||
env:
|
||||
OSS_GITHUB_ID: "a5d3c261b032765a78de"
|
||||
OSS_GITHUB_SECRET: $(oss-github-client-secret)
|
||||
INSIDERS_GITHUB_ID: "31f02627809389d9f111"
|
||||
INSIDERS_GITHUB_SECRET: $(insiders-github-client-secret)
|
||||
STABLE_GITHUB_ID: "baa8a44b5e861d918709"
|
||||
STABLE_GITHUB_SECRET: $(stable-github-client-secret)
|
||||
EXPLORATION_GITHUB_ID: "94e8376d3a90429aeaea"
|
||||
EXPLORATION_GITHUB_SECRET: $(exploration-github-client-secret)
|
||||
VSO_GITHUB_ID: "3d4be8f37a0325b5817d"
|
||||
VSO_GITHUB_SECRET: $(vso-github-client-secret)
|
||||
VSO_PPE_GITHUB_ID: "eabf35024dc2e891a492"
|
||||
VSO_PPE_GITHUB_SECRET: $(vso-ppe-github-client-secret)
|
||||
VSO_DEV_GITHUB_ID: "84383ebd8a7c5f5efc5c"
|
||||
VSO_DEV_GITHUB_SECRET: $(vso-dev-github-client-secret)
|
||||
|
||||
# Mixin must run before optimize, because the CSS loader will
|
||||
# inline small SVGs
|
||||
@@ -88,10 +103,10 @@ steps:
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
yarn gulp hygiene --skip-tslint
|
||||
yarn gulp tslint
|
||||
yarn gulp hygiene
|
||||
yarn monaco-compile-check
|
||||
displayName: Run hygiene, tslint and monaco compile checks
|
||||
yarn valid-layers-check
|
||||
displayName: Run hygiene, monaco compile & valid layers checks
|
||||
condition: and(succeeded(), ne(variables['CacheExists-Compilation'], 'true'), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
||||
|
||||
- script: |
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
resources:
|
||||
containers:
|
||||
- container: linux-x64
|
||||
image: sqltoolscontainers.azurecr.io/linux-build-agent:x64
|
||||
image: sqltoolscontainers.azurecr.io/linux-build-agent:1
|
||||
endpoint: ContainerRegistry
|
||||
|
||||
jobs:
|
||||
@@ -15,11 +15,12 @@ jobs:
|
||||
- job: macOS
|
||||
condition: eq(variables['VSCODE_BUILD_MACOS'], 'true')
|
||||
pool:
|
||||
vmImage: macOS 10.13
|
||||
vmImage: macOS-latest
|
||||
dependsOn:
|
||||
- Compile
|
||||
steps:
|
||||
- template: darwin/sql-product-build-darwin.yml
|
||||
timeoutInMinutes: 180
|
||||
|
||||
- job: Linux
|
||||
condition: eq(variables['VSCODE_BUILD_LINUX'], 'true')
|
||||
@@ -30,6 +31,7 @@ jobs:
|
||||
- Compile
|
||||
steps:
|
||||
- template: linux/sql-product-build-linux.yml
|
||||
timeoutInMinutes: 70
|
||||
|
||||
- job: Windows
|
||||
condition: eq(variables['VSCODE_BUILD_WIN32'], 'true')
|
||||
@@ -39,6 +41,7 @@ jobs:
|
||||
- Compile
|
||||
steps:
|
||||
- template: win32/sql-product-build-win32.yml
|
||||
timeoutInMinutes: 70
|
||||
|
||||
- job: Windows_Test
|
||||
condition: and(succeeded(), eq(variables['VSCODE_BUILD_WIN32'], 'true'))
|
||||
|
||||
@@ -87,9 +87,11 @@ steps:
|
||||
|
||||
- script: |
|
||||
set -e
|
||||
yarn gulp hygiene --skip-tslint
|
||||
yarn gulp tslint
|
||||
displayName: Run hygiene, tslint
|
||||
yarn sqllint
|
||||
yarn gulp hygiene
|
||||
yarn strict-vscode
|
||||
yarn valid-layers-check
|
||||
displayName: Run hygiene, eslint
|
||||
condition: and(succeeded(), ne(variables['CacheRestored-Compilation'], 'true'), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
||||
|
||||
- script: |
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="EsrpClient" version="1.0.27" />
|
||||
<package id="Microsoft.ESRPClient" version="1.2.25" />
|
||||
</packages>
|
||||
|
||||
@@ -29,20 +29,17 @@ steps:
|
||||
- powershell: |
|
||||
yarn electron
|
||||
- script: |
|
||||
yarn gulp hygiene --skip-tslint
|
||||
yarn gulp hygiene
|
||||
displayName: Run Hygiene Checks
|
||||
- script: |
|
||||
yarn gulp tslint
|
||||
displayName: Run TSLint Checks
|
||||
- script: | # {{SQL CARBON EDIT}} add step
|
||||
yarn tslint
|
||||
displayName: Run TSLint (gci)
|
||||
- script: | # {{SQL CARBON EDIT}} add step
|
||||
yarn strict-null-check
|
||||
yarn strict-vscode
|
||||
displayName: Run Strict Null Check
|
||||
# - powershell: | {{SQL CARBON EDIT}} remove step
|
||||
# yarn monaco-compile-check
|
||||
# displayName: Run Monaco Editor Checks
|
||||
- script: |
|
||||
yarn valid-layers-check
|
||||
displayName: Run Valid Layers Checks
|
||||
- powershell: |
|
||||
yarn compile
|
||||
displayName: Compile Sources
|
||||
@@ -51,10 +48,13 @@ steps:
|
||||
# displayName: Download Built-in Extensions
|
||||
- powershell: |
|
||||
.\scripts\test.bat --tfs "Unit Tests"
|
||||
displayName: Run Unit Tests
|
||||
displayName: Run Unit Tests (Electron)
|
||||
# - powershell: | {{SQL CARBON EDIT}} disable for now @TODO @anthonydresser
|
||||
# yarn test-browser --browser chromium
|
||||
# displayName: Run Unit Tests (Browser)
|
||||
# - powershell: | {{SQL CARBON EDIT}} remove step
|
||||
# .\scripts\test-integration.bat --tfs "Integration Tests"
|
||||
# displayName: Run Integration Tests
|
||||
# displayName: Run Integration Tests (Electron)
|
||||
- task: PublishTestResults@2
|
||||
displayName: Publish Tests Results
|
||||
inputs:
|
||||
|
||||
@@ -109,7 +109,14 @@ steps:
|
||||
$ErrorActionPreference = "Stop"
|
||||
exec { yarn electron $(VSCODE_ARCH) }
|
||||
exec { .\scripts\test.bat --build --tfs "Unit Tests" }
|
||||
displayName: Run unit tests
|
||||
displayName: Run unit tests (Electron)
|
||||
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
||||
|
||||
- powershell: |
|
||||
. build/azure-pipelines/win32/exec.ps1
|
||||
$ErrorActionPreference = "Stop"
|
||||
exec { yarn test-browser --build --browser chromium }
|
||||
displayName: Run unit tests (Browser)
|
||||
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
||||
|
||||
- powershell: |
|
||||
@@ -122,7 +129,24 @@ steps:
|
||||
$AppProductJson = Get-Content -Raw -Path "$AppRoot\resources\app\product.json" | ConvertFrom-Json
|
||||
$AppNameShort = $AppProductJson.nameShort
|
||||
exec { $env:INTEGRATION_TEST_ELECTRON_PATH = "$AppRoot\$AppNameShort.exe"; $env:VSCODE_REMOTE_SERVER_PATH = "$(agent.builddirectory)\vscode-reh-win32-$(VSCODE_ARCH)"; .\scripts\test-integration.bat --build --tfs "Integration Tests" }
|
||||
displayName: Run integration tests
|
||||
displayName: Run integration tests (Electron)
|
||||
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
||||
|
||||
- powershell: |
|
||||
. build/azure-pipelines/win32/exec.ps1
|
||||
$ErrorActionPreference = "Stop"
|
||||
$AppRoot = "$(agent.builddirectory)\VSCode-win32-$(VSCODE_ARCH)"
|
||||
$AppProductJson = Get-Content -Raw -Path "$AppRoot\resources\app\product.json" | ConvertFrom-Json
|
||||
$AppNameShort = $AppProductJson.nameShort
|
||||
exec { $env:INTEGRATION_TEST_ELECTRON_PATH = "$AppRoot\$AppNameShort.exe"; $env:VSCODE_REMOTE_SERVER_PATH = "$(agent.builddirectory)\vscode-reh-win32-$(VSCODE_ARCH)"; .\resources\server\test\test-remote-integration.bat }
|
||||
displayName: Run remote integration tests (Electron)
|
||||
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
||||
|
||||
- powershell: |
|
||||
. build/azure-pipelines/win32/exec.ps1
|
||||
$ErrorActionPreference = "Stop"
|
||||
exec { $env:VSCODE_REMOTE_SERVER_PATH = "$(agent.builddirectory)\vscode-reh-web-win32-$(VSCODE_ARCH)"; .\resources\server\test\test-web-integration.bat --browser firefox }
|
||||
displayName: Run integration tests (Browser)
|
||||
condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))
|
||||
|
||||
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
|
||||
|
||||
@@ -11,13 +11,12 @@ $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"
|
||||
$Server = "$Root\vscode-server-win32-$Arch"
|
||||
$ServerZip = "$Repo\.build\vscode-server-win32-$Arch.zip"
|
||||
$Build = "$Root\VSCode-win32-$Arch"
|
||||
|
||||
# Create server archive
|
||||
exec { Rename-Item -Path $LegacyServer -NewName $ServerName }
|
||||
exec { xcopy $LegacyServer $Server /H /E /I }
|
||||
exec { .\node_modules\7zip\7zip-lite\7z.exe a -tzip $ServerZip $Server -r }
|
||||
|
||||
# get version
|
||||
@@ -31,6 +30,8 @@ exec { node build/azure-pipelines/common/createAsset.js "$AssetPlatform" setup "
|
||||
exec { node build/azure-pipelines/common/createAsset.js "$AssetPlatform-user" setup "VSCodeUserSetup-$Arch-$Version.exe" $UserExe }
|
||||
exec { node build/azure-pipelines/common/createAsset.js "server-$AssetPlatform" archive "vscode-server-win32-$Arch.zip" $ServerZip }
|
||||
|
||||
# Skip hockey app because build failure.
|
||||
# https://github.com/microsoft/vscode/issues/90491
|
||||
# publish hockeyapp symbols
|
||||
$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 }
|
||||
# $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 }
|
||||
|
||||
@@ -67,4 +67,4 @@ $Input = Create-TmpJson @{
|
||||
|
||||
$Output = [System.IO.Path]::GetTempFileName()
|
||||
$ScriptPath = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
|
||||
& "$ScriptPath\ESRPClient\packages\EsrpClient.1.0.27\tools\ESRPClient.exe" Sign -a $Auth -p $Policy -i $Input -o $Output
|
||||
& "$ScriptPath\ESRPClient\packages\Microsoft.ESRPClient.1.2.25\tools\ESRPClient.exe" Sign -a $Auth -p $Policy -i $Input -o $Output
|
||||
|
||||
@@ -66,6 +66,8 @@ steps:
|
||||
$env:CHILD_CONCURRENCY="1"
|
||||
exec { yarn --frozen-lockfile }
|
||||
displayName: Install dependencies
|
||||
env:
|
||||
GITHUB_TOKEN: $(github-distro-mixin-password)
|
||||
condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
|
||||
|
||||
- task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
|
||||
@@ -260,17 +262,7 @@ steps:
|
||||
searchFolder: '$(Build.SourcesDirectory)'
|
||||
failTaskOnFailedTests: true
|
||||
continueOnError: true
|
||||
condition: and(succeeded(), eq(variables['RUN_TESTS'], 'true'))
|
||||
|
||||
- task: PublishTestResults@2
|
||||
displayName: 'Publish Integration and Smoke Test Results'
|
||||
inputs:
|
||||
testResultsFiles: '*.xml'
|
||||
searchFolder: '$(Build.ArtifactStagingDirectory)\test-results'
|
||||
mergeTestResults: true
|
||||
failTaskOnFailedTests: true
|
||||
continueOnError: true
|
||||
condition: and(succeeded(), eq(variables['RUN_TESTS'], 'true'))
|
||||
condition: and(succeeded(), eq(variables['RUN_UNSTABLE_TESTS'], 'true'))
|
||||
|
||||
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
|
||||
displayName: 'Component Detection'
|
||||
|
||||
@@ -19,6 +19,9 @@ steps:
|
||||
buildType: 'current'
|
||||
targetPath: '$(Build.SourcesDirectory)\.build'
|
||||
artifactName: drop
|
||||
itemPattern: |
|
||||
drop/extensions/**
|
||||
drop/win32-x64/**
|
||||
|
||||
- powershell: |
|
||||
. build/azure-pipelines/win32/exec.ps1
|
||||
@@ -38,7 +41,7 @@ steps:
|
||||
inputs:
|
||||
azureSubscription: 'ClientToolsInfra_670062 (88d5392f-a34f-4769-b405-f597fc533613)'
|
||||
KeyVaultName: SqlToolsSecretStore
|
||||
SecretsFilter: 'ads-integration-test-azure-server,ads-integration-test-azure-server-password,ads-integration-test-azure-server-username,ads-integration-test-bdc-server,ads-integration-test-bdc-server-password,ads-integration-test-bdc-server-username,ads-integration-test-standalone-server,ads-integration-test-standalone-server-password,ads-integration-test-standalone-server-username'
|
||||
SecretsFilter: 'ads-integration-test-azure-server,ads-integration-test-azure-server-password,ads-integration-test-azure-server-username,ads-integration-test-bdc-server,ads-integration-test-bdc-server-password,ads-integration-test-bdc-server-username,ads-integration-test-standalone-server,ads-integration-test-standalone-server-password,ads-integration-test-standalone-server-username,ads-integration-test-standalone-server-2019,ads-integration-test-standalone-server-password-2019,ads-integration-test-standalone-server-username-2019'
|
||||
|
||||
- powershell: |
|
||||
. build/azure-pipelines/win32/exec.ps1
|
||||
@@ -47,7 +50,7 @@ steps:
|
||||
$AppProductJson = Get-Content -Raw -Path "$AppRoot\resources\app\product.json" | ConvertFrom-Json
|
||||
$AppNameShort = $AppProductJson.nameShort
|
||||
exec { $env:INTEGRATION_TEST_ELECTRON_PATH = "$AppRoot\$AppNameShort.exe"; $env:INTEGRATION_TEST_CLI_PATH = "$AppRoot\bin\$AppNameShort"; .\scripts\sql-test-integration.bat }
|
||||
continueOnError: true
|
||||
continueOnError: false
|
||||
condition: and(succeeded(), eq(variables['RUN_TESTS'], 'true'))
|
||||
displayName: Run stable tests
|
||||
env:
|
||||
@@ -60,29 +63,9 @@ steps:
|
||||
AZURE_SQL_USERNAME: $(ads-integration-test-azure-server-username)
|
||||
AZURE_SQL_PWD: $(ads-integration-test-azure-server-password)
|
||||
AZURE_SQL: $(ads-integration-test-azure-server)
|
||||
|
||||
- powershell: |
|
||||
. build/azure-pipelines/win32/exec.ps1
|
||||
$ErrorActionPreference = "Stop"
|
||||
$AppRoot = "$(Agent.TempDirectory)\azuredatastudio-win32-x64"
|
||||
$AppProductJson = Get-Content -Raw -Path "$AppRoot\resources\app\product.json" | ConvertFrom-Json
|
||||
$AppNameShort = $AppProductJson.nameShort
|
||||
exec { $env:INTEGRATION_TEST_ELECTRON_PATH = "$AppRoot\$AppNameShort.exe"; $env:INTEGRATION_TEST_CLI_PATH = "$AppRoot\bin\$AppNameShort"; .\scripts\sql-test-integration.bat }
|
||||
continueOnError: true
|
||||
condition: and(succeeded(), eq(variables['RUN_TESTS'], 'true'))
|
||||
displayName: Run release tests
|
||||
env:
|
||||
ADS_TEST_GREP: (.*@REL@|integration test setup)
|
||||
ADS_TEST_INVERT_GREP: 0
|
||||
BDC_BACKEND_USERNAME: $(ads-integration-test-bdc-server-username)
|
||||
BDC_BACKEND_PWD: $(ads-integration-test-bdc-server-password)
|
||||
BDC_BACKEND_HOSTNAME: $(ads-integration-test-bdc-server)
|
||||
STANDALONE_SQL_USERNAME: $(ads-integration-test-standalone-server-username)
|
||||
STANDALONE_SQL_PWD: $(ads-integration-test-standalone-server-password)
|
||||
STANDALONE_SQL: $(ads-integration-test-standalone-server)
|
||||
AZURE_SQL_USERNAME: $(ads-integration-test-azure-server-username)
|
||||
AZURE_SQL_PWD: $(ads-integration-test-azure-server-password)
|
||||
AZURE_SQL: $(ads-integration-test-azure-server)
|
||||
STANDALONE_SQL_USERNAME_2019: $(ads-integration-test-standalone-server-username-2019)
|
||||
STANDALONE_SQL_PWD_2019: $(ads-integration-test-standalone-server-password-2019)
|
||||
STANDALONE_SQL_2019: $(ads-integration-test-standalone-server-2019)
|
||||
|
||||
- powershell: |
|
||||
. build/azure-pipelines/win32/exec.ps1
|
||||
@@ -104,3 +87,16 @@ steps:
|
||||
AZURE_SQL_USERNAME: $(ads-integration-test-azure-server-username)
|
||||
AZURE_SQL_PWD: $(ads-integration-test-azure-server-password)
|
||||
AZURE_SQL: $(ads-integration-test-azure-server)
|
||||
STANDALONE_SQL_USERNAME_2019: $(ads-integration-test-standalone-server-username-2019)
|
||||
STANDALONE_SQL_PWD_2019: $(ads-integration-test-standalone-server-password-2019)
|
||||
STANDALONE_SQL_2019: $(ads-integration-test-standalone-server-2019)
|
||||
|
||||
- task: PublishTestResults@2
|
||||
displayName: 'Publish Integration and Smoke Test Results'
|
||||
inputs:
|
||||
testResultsFiles: '*.xml'
|
||||
searchFolder: '$(Build.ArtifactStagingDirectory)\test-results'
|
||||
mergeTestResults: true
|
||||
failTaskOnFailedTests: true
|
||||
continueOnError: true
|
||||
condition: and(succeeded(), eq(variables['RUN_TESTS'], 'true'))
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
[
|
||||
{
|
||||
"name": "Microsoft.sqlservernotebook",
|
||||
"version": "0.3.3",
|
||||
"repo": "https://github.com/Microsoft/azuredatastudio"
|
||||
}
|
||||
]
|
||||
@@ -1,7 +1,7 @@
|
||||
[
|
||||
{
|
||||
"name": "Microsoft.sqlservernotebook",
|
||||
"version": "0.3.3",
|
||||
"version": "0.3.5",
|
||||
"repo": "https://github.com/Microsoft/azuredatastudio"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -10,6 +10,7 @@ const os = require('os');
|
||||
const { remote } = require('electron');
|
||||
const dialog = remote.dialog;
|
||||
|
||||
const productJsonPath = path.join(__dirname, '..', '..', 'product.json');
|
||||
const builtInExtensionsPath = path.join(__dirname, '..', 'builtInExtensions.json');
|
||||
const controlFilePath = path.join(os.homedir(), '.vscode-oss-dev', 'extensions', 'control.json');
|
||||
|
||||
@@ -51,6 +52,7 @@ function render(el, state) {
|
||||
}
|
||||
|
||||
const ul = document.createElement('ul');
|
||||
const { quality } = readJson(productJsonPath);
|
||||
const { builtin, control } = state;
|
||||
|
||||
for (const ext of builtin) {
|
||||
@@ -61,6 +63,10 @@ function render(el, state) {
|
||||
|
||||
const name = document.createElement('code');
|
||||
name.textContent = ext.name;
|
||||
if (quality && ext.forQualities && !ext.forQualities.includes(quality)) {
|
||||
name.textContent += ` (only on ${ext.forQualities.join(', ')})`;
|
||||
}
|
||||
|
||||
li.appendChild(name);
|
||||
|
||||
const form = document.createElement('form');
|
||||
@@ -123,4 +129,4 @@ function main() {
|
||||
render(el, { builtin, control });
|
||||
}
|
||||
|
||||
window.onload = main;
|
||||
window.onload = main;
|
||||
|
||||
@@ -16,15 +16,17 @@ const cp = require('child_process');
|
||||
const compilation = require('./lib/compilation');
|
||||
const monacoapi = require('./monaco/api');
|
||||
const fs = require('fs');
|
||||
const webpack = require('webpack');
|
||||
const webpackGulp = require('webpack-stream');
|
||||
|
||||
var root = path.dirname(__dirname);
|
||||
var sha1 = util.getVersion(root);
|
||||
var semver = require('./monaco/package.json').version;
|
||||
var headerVersion = semver + '(' + sha1 + ')';
|
||||
let root = path.dirname(__dirname);
|
||||
let sha1 = util.getVersion(root);
|
||||
let semver = require('./monaco/package.json').version;
|
||||
let headerVersion = semver + '(' + sha1 + ')';
|
||||
|
||||
// Build
|
||||
|
||||
var editorEntryPoints = [
|
||||
let editorEntryPoints = [
|
||||
{
|
||||
name: 'vs/editor/editor.main',
|
||||
include: [],
|
||||
@@ -40,11 +42,11 @@ var editorEntryPoints = [
|
||||
}
|
||||
];
|
||||
|
||||
var editorResources = [
|
||||
let editorResources = [
|
||||
'out-editor-build/vs/base/browser/ui/codiconLabel/**/*.ttf'
|
||||
];
|
||||
|
||||
var BUNDLED_FILE_HEADER = [
|
||||
let BUNDLED_FILE_HEADER = [
|
||||
'/*!-----------------------------------------------------------',
|
||||
' * Copyright (c) Microsoft Corporation. All rights reserved.',
|
||||
' * Version: ' + headerVersion,
|
||||
@@ -197,7 +199,7 @@ const compileEditorESMTask = task.define('compile-editor-esm', () => {
|
||||
});
|
||||
|
||||
function toExternalDTS(contents) {
|
||||
let lines = contents.split('\n');
|
||||
let lines = contents.split(/\r\n|\r|\n/);
|
||||
let killNextCloseCurlyBrace = false;
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
let line = lines[i];
|
||||
@@ -227,8 +229,13 @@ function toExternalDTS(contents) {
|
||||
if (line.indexOf('declare namespace monaco.') === 0) {
|
||||
lines[i] = line.replace('declare namespace monaco.', 'export namespace ');
|
||||
}
|
||||
|
||||
if (line.indexOf('declare let MonacoEnvironment') === 0) {
|
||||
lines[i] = `declare global {\n let MonacoEnvironment: Environment | undefined;\n}`;
|
||||
// lines[i] = line.replace('declare namespace monaco.', 'export namespace ');
|
||||
}
|
||||
}
|
||||
return lines.join('\n');
|
||||
return lines.join('\n').replace(/\n\n\n+/g, '\n\n');
|
||||
}
|
||||
|
||||
function filterStream(testFunc) {
|
||||
@@ -263,7 +270,7 @@ const finalEditorResourcesTask = task.define('final-editor-resources', () => {
|
||||
// package.json
|
||||
gulp.src('build/monaco/package.json')
|
||||
.pipe(es.through(function (data) {
|
||||
var json = JSON.parse(data.contents.toString());
|
||||
let json = JSON.parse(data.contents.toString());
|
||||
json.private = false;
|
||||
data.contents = Buffer.from(JSON.stringify(json, null, ' '));
|
||||
this.emit('data', data);
|
||||
@@ -307,10 +314,10 @@ const finalEditorResourcesTask = task.define('final-editor-resources', () => {
|
||||
return;
|
||||
}
|
||||
|
||||
var relativePathToMap = path.relative(path.join(data.relative), path.join('min-maps', data.relative + '.map'));
|
||||
let relativePathToMap = path.relative(path.join(data.relative), path.join('min-maps', data.relative + '.map'));
|
||||
|
||||
var strContents = data.contents.toString();
|
||||
var newStr = '//# sourceMappingURL=' + relativePathToMap.replace(/\\/g, '/');
|
||||
let strContents = data.contents.toString();
|
||||
let newStr = '//# sourceMappingURL=' + relativePathToMap.replace(/\\/g, '/');
|
||||
strContents = strContents.replace(/\/\/# sourceMappingURL=[^ ]+$/, newStr);
|
||||
|
||||
data.contents = Buffer.from(strContents);
|
||||
@@ -353,6 +360,56 @@ gulp.task('editor-distro',
|
||||
)
|
||||
);
|
||||
|
||||
const bundleEditorESMTask = task.define('editor-esm-bundle-webpack', () => {
|
||||
const result = es.through();
|
||||
|
||||
const webpackConfigPath = path.join(root, 'build/monaco/monaco.webpack.config.js');
|
||||
|
||||
const webpackConfig = {
|
||||
...require(webpackConfigPath),
|
||||
...{ mode: 'production' }
|
||||
};
|
||||
|
||||
const webpackDone = (err, stats) => {
|
||||
if (err) {
|
||||
result.emit('error', err);
|
||||
return;
|
||||
}
|
||||
const { compilation } = stats;
|
||||
if (compilation.errors.length > 0) {
|
||||
result.emit('error', compilation.errors.join('\n'));
|
||||
}
|
||||
if (compilation.warnings.length > 0) {
|
||||
result.emit('data', compilation.warnings.join('\n'));
|
||||
}
|
||||
};
|
||||
|
||||
return webpackGulp(webpackConfig, webpack, webpackDone)
|
||||
.pipe(gulp.dest('out-editor-esm-bundle'));
|
||||
});
|
||||
|
||||
gulp.task('editor-esm-bundle',
|
||||
task.series(
|
||||
task.parallel(
|
||||
util.rimraf('out-editor-src'),
|
||||
util.rimraf('out-editor-esm'),
|
||||
util.rimraf('out-monaco-editor-core'),
|
||||
util.rimraf('out-editor-esm-bundle'),
|
||||
),
|
||||
extractEditorSrcTask,
|
||||
createESMSourcesAndResourcesTask,
|
||||
compileEditorESMTask,
|
||||
bundleEditorESMTask,
|
||||
)
|
||||
);
|
||||
|
||||
gulp.task('monacodts', task.define('monacodts', () => {
|
||||
const result = monacoapi.execute();
|
||||
fs.writeFileSync(result.filePath, result.content);
|
||||
fs.writeFileSync(path.join(root, 'src/vs/editor/common/standalone/standaloneEnums.ts'), result.enums);
|
||||
return Promise.resolve(true);
|
||||
}));
|
||||
|
||||
//#region monaco type checking
|
||||
|
||||
function createTscCompileTask(watch) {
|
||||
|
||||
@@ -8,10 +8,8 @@
|
||||
const gulp = require('gulp');
|
||||
const filter = require('gulp-filter');
|
||||
const es = require('event-stream');
|
||||
const gulptslint = require('gulp-tslint');
|
||||
const gulpeslint = require('gulp-eslint');
|
||||
const tsfmt = require('typescript-formatter');
|
||||
const tslint = require('tslint');
|
||||
const VinylFile = require('vinyl');
|
||||
const vfs = require('vinyl-fs');
|
||||
const path = require('path');
|
||||
@@ -35,7 +33,9 @@ const all = [
|
||||
'scripts/**/*',
|
||||
'src/**/*',
|
||||
'test/**/*',
|
||||
'!**/node_modules/**'
|
||||
'!test/**/out/**',
|
||||
'!**/node_modules/**',
|
||||
'!build/actions/**/dist/*' // {{ SQL CARBON EDIT }}
|
||||
];
|
||||
|
||||
const indentationFilter = [
|
||||
@@ -55,8 +55,7 @@ const indentationFilter = [
|
||||
'!src/vs/base/common/marked/marked.js',
|
||||
'!src/vs/base/node/terminateProcess.sh',
|
||||
'!src/vs/base/node/cpuUsage.sh',
|
||||
'!test/assert.js',
|
||||
'!build/testSetup.js',
|
||||
'!test/unit/assert.js',
|
||||
|
||||
// except specific folders
|
||||
'!test/automation/out/**',
|
||||
@@ -86,8 +85,8 @@ const indentationFilter = [
|
||||
'!src/vs/*/**/*.d.ts',
|
||||
'!src/typings/**/*.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}',
|
||||
'!build/{lib,tslintRules,download}/**/*.js',
|
||||
'!**/*.{svg,exe,png,bmp,scpt,bat,cmd,cur,ttf,woff,eot,md,ps1,template,yaml,yml,d.ts.recipe,ico,icns,plist}',
|
||||
'!build/{lib,download}/**/*.js',
|
||||
'!build/**/*.sh',
|
||||
'!build/azure-pipelines/**/*.js',
|
||||
'!build/azure-pipelines/**/*.config',
|
||||
@@ -97,14 +96,17 @@ const indentationFilter = [
|
||||
'!**/*.dockerfile',
|
||||
'!extensions/markdown-language-features/media/*.js',
|
||||
// {{SQL CARBON EDIT}}
|
||||
'!build/actions/**/dist/*',
|
||||
'!**/*.{xlf,docx,sql,vsix,bacpac,ipynb}',
|
||||
'!extensions/mssql/sqltoolsservice/**',
|
||||
'!extensions/import/flatfileimportservice/**',
|
||||
'!extensions/admin-tool-ext-win/ssmsmin/**',
|
||||
'!extensions/resource-deployment/notebooks/**',
|
||||
'!extensions/mssql/notebooks/**',
|
||||
'!extensions/integration-tests/testData/**',
|
||||
'!extensions/big-data-cluster/src/bigDataCluster/controller/apiGenerated.ts',
|
||||
'!extensions/big-data-cluster/src/bigDataCluster/controller/clusterApiGenerated2.ts'
|
||||
'!extensions/big-data-cluster/src/bigDataCluster/controller/clusterApiGenerated2.ts',
|
||||
'!resources/linux/snap/electron-launch'
|
||||
];
|
||||
|
||||
const copyrightFilter = [
|
||||
@@ -142,9 +144,9 @@ const copyrightFilter = [
|
||||
'!extensions/mssql/src/hdfs/webhdfs.ts',
|
||||
'!src/sql/workbench/contrib/notebook/browser/outputs/tableRenderers.ts',
|
||||
'!src/sql/workbench/contrib/notebook/common/models/url.ts',
|
||||
'!src/sql/workbench/contrib/notebook/browser/models/renderMimeInterfaces.ts',
|
||||
'!src/sql/workbench/services/notebook/browser/outputs/renderMimeInterfaces.ts',
|
||||
'!src/sql/workbench/contrib/notebook/browser/models/outputProcessor.ts',
|
||||
'!src/sql/workbench/contrib/notebook/browser/models/mimemodel.ts',
|
||||
'!src/sql/workbench/services/notebook/browser/outputs/mimemodel.ts',
|
||||
'!src/sql/workbench/contrib/notebook/browser/cellViews/media/*.css',
|
||||
'!src/sql/base/browser/ui/table/plugins/rowSelectionModel.plugin.ts',
|
||||
'!src/sql/base/browser/ui/table/plugins/rowDetailView.ts',
|
||||
@@ -152,11 +154,11 @@ const copyrightFilter = [
|
||||
'!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/contrib/notebook/browser/outputs/sanitizer.ts',
|
||||
'!src/sql/workbench/services/notebook/browser/outputs/sanitizer.ts',
|
||||
'!src/sql/workbench/contrib/notebook/browser/outputs/renderers.ts',
|
||||
'!src/sql/workbench/contrib/notebook/browser/outputs/registry.ts',
|
||||
'!src/sql/workbench/contrib/notebook/browser/outputs/factories.ts',
|
||||
'!src/sql/workbench/contrib/notebook/common/models/nbformat.ts',
|
||||
'!src/sql/workbench/services/notebook/browser/outputs/registry.ts',
|
||||
'!src/sql/workbench/services/notebook/browser/outputs/factories.ts',
|
||||
'!src/sql/workbench/services/notebook/common/nbformat.ts',
|
||||
'!extensions/markdown-language-features/media/tomorrow.css',
|
||||
'!src/sql/workbench/browser/modelComponents/media/highlight.css',
|
||||
'!src/sql/workbench/contrib/notebook/electron-browser/cellViews/media/highlight.css',
|
||||
@@ -172,7 +174,7 @@ const copyrightFilter = [
|
||||
'!**/*.bacpac'
|
||||
];
|
||||
|
||||
const eslintFilter = [
|
||||
const jsHygieneFilter = [
|
||||
'src/**/*.js',
|
||||
'build/gulpfile.*.js',
|
||||
'!src/vs/loader.js',
|
||||
@@ -185,7 +187,10 @@ const eslintFilter = [
|
||||
'!**/test/**'
|
||||
];
|
||||
|
||||
const tslintBaseFilter = [
|
||||
const tsHygieneFilter = [
|
||||
'src/**/*.ts',
|
||||
'test/**/*.ts',
|
||||
'extensions/**/*.ts',
|
||||
'!**/fixtures/**',
|
||||
'!**/typings/**',
|
||||
'!**/node_modules/**',
|
||||
@@ -196,68 +201,10 @@ const tslintBaseFilter = [
|
||||
'!extensions/html-language-features/server/lib/jquery.d.ts',
|
||||
'!extensions/big-data-cluster/src/bigDataCluster/controller/apiGenerated.ts', // {{SQL CARBON EDIT}},
|
||||
'!extensions/big-data-cluster/src/bigDataCluster/controller/tokenApiGenerated.ts', // {{SQL CARBON EDIT}},
|
||||
'!src/vs/workbench/services/themes/common/textMateScopeMatcher.ts' // {{SQL CARBON EDIT}} skip this because we have no plans on touching this and its not ours
|
||||
'!src/vs/workbench/services/themes/common/textMateScopeMatcher.ts', // {{SQL CARBON EDIT}} skip this because we have no plans on touching this and its not ours
|
||||
'!src/vs/workbench/contrib/extensions/browser/extensionTipsService.ts' // {{SQL CARBON EDIT}} skip this because known issue
|
||||
];
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
const sqlFilter = [
|
||||
'src/sql/**',
|
||||
'extensions/**',
|
||||
// Ignore VS Code extensions
|
||||
'!extensions/bat/**',
|
||||
'!extensions/configuration-editing/**',
|
||||
'!extensions/docker/**',
|
||||
'!extensions/extension-editing/**',
|
||||
'!extensions/git/**',
|
||||
'!extensions/git-ui/**',
|
||||
'!extensions/image-preview/**',
|
||||
'!extensions/insights-default/**',
|
||||
'!extensions/json/**',
|
||||
'!extensions/json-language-features/**',
|
||||
'!extensions/markdown-basics/**',
|
||||
'!extensions/markdown-language-features/**',
|
||||
'!extensions/merge-conflict/**',
|
||||
'!extensions/powershell/**',
|
||||
'!extensions/python/**',
|
||||
'!extensions/r/**',
|
||||
'!extensions/theme-*/**',
|
||||
'!extensions/vscode-*/**',
|
||||
'!extensions/xml/**',
|
||||
'!extensions/xml-language-features/**',
|
||||
'!extensions/yarml/**',
|
||||
];
|
||||
|
||||
const tslintCoreFilter = [
|
||||
'src/**/*.ts',
|
||||
'test/**/*.ts',
|
||||
'!extensions/**/*.ts',
|
||||
'!test/automation/**',
|
||||
'!test/smoke/**',
|
||||
...tslintBaseFilter
|
||||
];
|
||||
|
||||
const tslintExtensionsFilter = [
|
||||
'extensions/**/*.ts',
|
||||
'!src/**/*.ts',
|
||||
'!test/**/*.ts',
|
||||
'test/automation/**/*.ts',
|
||||
...tslintBaseFilter
|
||||
];
|
||||
|
||||
const tslintHygieneFilter = [
|
||||
'src/**/*.ts',
|
||||
'test/**/*.ts',
|
||||
'extensions/**/*.ts',
|
||||
'!src/vs/workbench/contrib/extensions/browser/extensionTipsService.ts', // {{SQL CARBON EDIT}} known formatting issue do to commenting out code
|
||||
...tslintBaseFilter
|
||||
];
|
||||
|
||||
const fileLengthFilter = filter([
|
||||
'**',
|
||||
'!extensions/import/*.docx',
|
||||
'!extensions/admin-tool-ext-win/license/**'
|
||||
], {restore: true});
|
||||
|
||||
const copyrightHeaderLines = [
|
||||
'/*---------------------------------------------------------------------------------------------',
|
||||
' * Copyright (c) Microsoft Corporation. All rights reserved.',
|
||||
@@ -267,27 +214,17 @@ const copyrightHeaderLines = [
|
||||
|
||||
gulp.task('eslint', () => {
|
||||
return vfs.src(all, { base: '.', follow: true, allowEmpty: true })
|
||||
.pipe(filter(eslintFilter))
|
||||
.pipe(gulpeslint('src/.eslintrc'))
|
||||
.pipe(filter(jsHygieneFilter.concat(tsHygieneFilter)))
|
||||
.pipe(gulpeslint({
|
||||
configFile: '.eslintrc.json',
|
||||
rulePaths: ['./build/lib/eslint']
|
||||
}))
|
||||
.pipe(gulpeslint.formatEach('compact'))
|
||||
.pipe(gulpeslint.failAfterError());
|
||||
});
|
||||
|
||||
gulp.task('tslint', () => {
|
||||
return es.merge([
|
||||
|
||||
// Core: include type information (required by certain rules like no-nodejs-globals)
|
||||
vfs.src(all, { base: '.', follow: true, allowEmpty: true })
|
||||
.pipe(filter(tslintCoreFilter))
|
||||
.pipe(gulptslint.default({ rulesDirectory: 'build/lib/tslint', program: tslint.Linter.createProgram('src/tsconfig.json') }))
|
||||
.pipe(gulptslint.default.report({ emitError: true })),
|
||||
|
||||
// Exenstions: do not include type information
|
||||
vfs.src(all, { base: '.', follow: true, allowEmpty: true })
|
||||
.pipe(filter(tslintExtensionsFilter))
|
||||
.pipe(gulptslint.default({ rulesDirectory: 'build/lib/tslint' }))
|
||||
.pipe(gulptslint.default.report({ emitError: true }))
|
||||
]).pipe(es.through());
|
||||
.pipe(gulpeslint.results(results => {
|
||||
if (results.warningCount > 0 || results.errorCount > 0) {
|
||||
throw new Error('eslint failed with warnings and/or errors');
|
||||
}
|
||||
}));
|
||||
});
|
||||
|
||||
function checkPackageJSON(actualPath) {
|
||||
@@ -309,7 +246,7 @@ function checkPackageJSON(actualPath) {
|
||||
|
||||
const checkPackageJSONTask = task.define('check-package-json', () => {
|
||||
return gulp.src('package.json')
|
||||
.pipe(es.through(function() {
|
||||
.pipe(es.through(function () {
|
||||
checkPackageJSON.call(this, 'remote/package.json');
|
||||
checkPackageJSON.call(this, 'remote/web/package.json');
|
||||
}));
|
||||
@@ -376,8 +313,6 @@ function hygiene(some) {
|
||||
replace: undefined,
|
||||
tsconfig: undefined,
|
||||
tsconfigFile: undefined,
|
||||
tslint: undefined,
|
||||
tslintFile: undefined,
|
||||
tsfmtFile: undefined,
|
||||
vscode: undefined,
|
||||
vscodeFile: undefined
|
||||
@@ -386,7 +321,7 @@ function hygiene(some) {
|
||||
let formatted = result.dest.replace(/\r\n/gm, '\n');
|
||||
|
||||
if (original !== formatted) {
|
||||
console.error("File not formatted. Run the 'Format Document' command to fix it:", file.relative);
|
||||
console.error('File not formatted. Run the \'Format Document\' command to fix it:', file.relative);
|
||||
errorCount++;
|
||||
}
|
||||
cb(null, file);
|
||||
@@ -396,33 +331,6 @@ function hygiene(some) {
|
||||
});
|
||||
});
|
||||
|
||||
const filelength = es.through(function (file) {
|
||||
|
||||
const fileName = path.basename(file.relative);
|
||||
const fileDir = path.dirname(file.relative);
|
||||
//check the filename is < 50 characters (basename gets the filename with extension).
|
||||
if (fileName.length > 50) {
|
||||
console.error(`File name '${fileName}' under ${fileDir} is too long. Rename file to have less than 50 characters.`);
|
||||
errorCount++;
|
||||
}
|
||||
if (file.relative.length > 150) {
|
||||
console.error(`File path ${file.relative} exceeds acceptable file-length. Rename the path to have less than 150 characters.`);
|
||||
errorCount++;
|
||||
}
|
||||
|
||||
this.emit('data', file);
|
||||
});
|
||||
|
||||
const tslintConfiguration = tslint.Configuration.findConfiguration('tslint.json', '.');
|
||||
const tslintOptions = { fix: false, formatter: 'json' };
|
||||
const tsLinter = new tslint.Linter(tslintOptions);
|
||||
|
||||
const tsl = es.through(function (file) {
|
||||
const contents = file.contents.toString('utf8');
|
||||
tsLinter.lint(file.relative, contents, tslintConfiguration.results);
|
||||
this.emit('data', file);
|
||||
});
|
||||
|
||||
let input;
|
||||
|
||||
if (Array.isArray(some) || typeof some === 'string' || !some) {
|
||||
@@ -436,22 +344,9 @@ function hygiene(some) {
|
||||
input = some;
|
||||
}
|
||||
|
||||
// {{SQL CARBON EDIT}} Linting for SQL
|
||||
const tslintSqlConfiguration = tslint.Configuration.findConfiguration('tslint-sql.json', '.');
|
||||
const tslintSqlOptions = { fix: false, formatter: 'json' };
|
||||
const sqlTsLinter = new tslint.Linter(tslintSqlOptions);
|
||||
|
||||
const sqlTsl = es.through(function (file) { //TODO restore
|
||||
const contents = file.contents.toString('utf8');
|
||||
sqlTsLinter.lint(file.relative, contents, tslintSqlConfiguration.results);
|
||||
});
|
||||
|
||||
const productJsonFilter = filter('product.json', { restore: true });
|
||||
|
||||
const result = input
|
||||
.pipe(fileLengthFilter)
|
||||
.pipe(filelength)
|
||||
.pipe(fileLengthFilter.restore)
|
||||
.pipe(filter(f => !f.stat.isDirectory()))
|
||||
.pipe(productJsonFilter)
|
||||
.pipe(process.env['BUILD_SOURCEVERSION'] ? es.through() : productJson)
|
||||
@@ -461,22 +356,21 @@ function hygiene(some) {
|
||||
.pipe(filter(copyrightFilter))
|
||||
.pipe(copyrights);
|
||||
|
||||
let typescript = result
|
||||
.pipe(filter(tslintHygieneFilter))
|
||||
const typescript = result
|
||||
.pipe(filter(tsHygieneFilter))
|
||||
.pipe(formatting);
|
||||
|
||||
if (!process.argv.some(arg => arg === '--skip-tslint')) {
|
||||
typescript = typescript.pipe(tsl);
|
||||
typescript = typescript
|
||||
.pipe(filter(sqlFilter)) // {{SQL CARBON EDIT}}
|
||||
.pipe(sqlTsl);
|
||||
}
|
||||
|
||||
const javascript = result
|
||||
.pipe(filter(eslintFilter))
|
||||
.pipe(gulpeslint('src/.eslintrc'))
|
||||
.pipe(filter(jsHygieneFilter.concat(tsHygieneFilter)))
|
||||
.pipe(gulpeslint({
|
||||
configFile: '.eslintrc.json',
|
||||
rulePaths: ['./build/lib/eslint']
|
||||
}))
|
||||
.pipe(gulpeslint.formatEach('compact'))
|
||||
.pipe(gulpeslint.failAfterError());
|
||||
.pipe(gulpeslint.results(results => {
|
||||
errorCount += results.warningCount;
|
||||
errorCount += results.errorCount;
|
||||
}));
|
||||
|
||||
let count = 0;
|
||||
return es.merge(typescript, javascript)
|
||||
@@ -488,33 +382,6 @@ function hygiene(some) {
|
||||
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;
|
||||
}
|
||||
|
||||
const sqlTslintResult = sqlTsLinter.getResult();
|
||||
if (sqlTslintResult.failures.length > 0) {
|
||||
for (const failure of sqlTslintResult.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 += sqlTslintResult.failures.length;
|
||||
}
|
||||
|
||||
if (errorCount > 0) {
|
||||
this.emit('error', 'Hygiene failed with ' + errorCount + ' errors. Check \'build/gulpfile.hygiene.js\'.');
|
||||
} else {
|
||||
|
||||
@@ -118,7 +118,7 @@ function mixinServer(watch) {
|
||||
const packageJSONPath = path.join(path.dirname(__dirname), 'package.json');
|
||||
function exec(cmdLine) {
|
||||
console.log(cmdLine);
|
||||
cp.execSync(cmdLine, { stdio: "inherit" });
|
||||
cp.execSync(cmdLine, { stdio: 'inherit' });
|
||||
}
|
||||
function checkout() {
|
||||
const packageJSON = JSON.parse(fs.readFileSync(packageJSONPath).toString());
|
||||
|
||||
@@ -102,7 +102,10 @@ function installService() {
|
||||
let runtime = p.runtimeId;
|
||||
// fix path since it won't be correct
|
||||
config.installDirectory = path.join(__dirname, '../extensions/mssql/src', config.installDirectory);
|
||||
var installer = new serviceDownloader(config);
|
||||
let installer = new serviceDownloader(config);
|
||||
installer.eventEmitter.onAny((event, ...values) => {
|
||||
console.log(`ServiceDownloader Event : ${event}${values && values.length > 0 ? ` - ${values.join(' ')}` : ''}`);
|
||||
});
|
||||
let serviceInstallFolder = installer.getInstallDirectory(runtime);
|
||||
console.log('Cleaning up the install folder: ' + serviceInstallFolder);
|
||||
return del(serviceInstallFolder + '/*').then(() => {
|
||||
@@ -123,7 +126,10 @@ gulp.task('install-ssmsmin', () => {
|
||||
const runtime = 'Windows_64'; // admin-tool-ext is a windows only extension, and we only ship a 64 bit version, so locking the binaries as such
|
||||
// fix path since it won't be correct
|
||||
config.installDirectory = path.join(__dirname, '..', 'extensions', 'admin-tool-ext-win', config.installDirectory);
|
||||
var installer = new serviceDownloader(config);
|
||||
let installer = new serviceDownloader(config);
|
||||
installer.eventEmitter.onAny((event, ...values) => {
|
||||
console.log(`ServiceDownloader Event : ${event}${values && values.length > 0 ? ` - ${values.join(' ')}` : ''}`);
|
||||
});
|
||||
const serviceInstallFolder = installer.getInstallDirectory(runtime);
|
||||
const serviceCleanupFolder = path.join(serviceInstallFolder, '..');
|
||||
console.log('Cleaning up the install folder: ' + serviceCleanupFolder);
|
||||
|
||||
@@ -43,6 +43,7 @@ const nodeModules = [
|
||||
'electron',
|
||||
'original-fs',
|
||||
'rxjs/Observable',
|
||||
'rxjs/add/observable/fromPromise',
|
||||
'rxjs/Subject',
|
||||
'rxjs/Observer',
|
||||
'slickgrid/lib/jquery.event.drag-2.3.0',
|
||||
@@ -150,9 +151,9 @@ gulp.task(minifyVSCodeTask);
|
||||
* @return {Object} A map of paths to checksums.
|
||||
*/
|
||||
function computeChecksums(out, filenames) {
|
||||
var result = {};
|
||||
let result = {};
|
||||
filenames.forEach(function (filename) {
|
||||
var fullPath = path.join(process.cwd(), out, filename);
|
||||
let fullPath = path.join(process.cwd(), out, filename);
|
||||
result[filename] = computeChecksum(fullPath);
|
||||
});
|
||||
return result;
|
||||
@@ -165,9 +166,9 @@ function computeChecksums(out, filenames) {
|
||||
* @return {string} The checksum for `filename`.
|
||||
*/
|
||||
function computeChecksum(filename) {
|
||||
var contents = fs.readFileSync(filename);
|
||||
let contents = fs.readFileSync(filename);
|
||||
|
||||
var hash = crypto
|
||||
let hash = crypto
|
||||
.createHash('md5')
|
||||
.update(contents)
|
||||
.digest('base64')
|
||||
@@ -236,7 +237,6 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
|
||||
const api = gulp.src('src/vs/vscode.d.ts').pipe(rename('out/vs/vscode.d.ts'));
|
||||
// {{SQL CARBON EDIT}}
|
||||
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 telemetry = gulp.src('.build/telemetry/**', { base: '.build/telemetry', dot: true });
|
||||
|
||||
@@ -253,8 +253,7 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
|
||||
productJsonStream,
|
||||
license,
|
||||
api,
|
||||
dataApi,
|
||||
sqlopsAPI, // {{SQL CARBON EDIT}}
|
||||
dataApi, // {{SQL CARBON EDIT}}
|
||||
telemetry,
|
||||
sources,
|
||||
deps
|
||||
@@ -276,6 +275,9 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
|
||||
}
|
||||
|
||||
let result = all
|
||||
.pipe(fileLengthFilter)
|
||||
.pipe(filelength)
|
||||
.pipe(fileLengthFilter.restore)
|
||||
.pipe(util.skipDirectories())
|
||||
.pipe(util.fixWin32DirectoryPermissions())
|
||||
.pipe(electron(_.extend({}, config, { platform, arch, ffmpegChromium: true })))
|
||||
@@ -330,6 +332,29 @@ function packageTask(platform, arch, sourceFolderName, destinationFolderName, op
|
||||
};
|
||||
}
|
||||
|
||||
const fileLengthFilter = filter([
|
||||
'**',
|
||||
'!extensions/import/*.docx',
|
||||
'!extensions/admin-tool-ext-win/license/**'
|
||||
], {restore: true});
|
||||
|
||||
const filelength = es.through(function (file) {
|
||||
|
||||
const fileName = path.basename(file.relative);
|
||||
const fileDir = path.dirname(file.relative);
|
||||
//check the filename is < 50 characters (basename gets the filename with extension).
|
||||
if (fileName.length > 50) {
|
||||
console.error(`File name '${fileName}' under ${fileDir} is too long. Rename file to have less than 50 characters.`);
|
||||
throw new Error('File name exceeds acceptable length of 50 characters: ' + fileName);
|
||||
}
|
||||
if (file.relative.length > 150) {
|
||||
console.error(`File path ${file.relative} exceeds acceptable file-length. Rename the path to have less than 150 characters.`);
|
||||
throw new Error('File path exceeds acceptable path-length of 150 characters: ' + file.relative);
|
||||
}
|
||||
|
||||
this.emit('data', file);
|
||||
});
|
||||
|
||||
const buildRoot = path.dirname(root);
|
||||
|
||||
const BUILD_TARGETS = [
|
||||
|
||||
@@ -23,7 +23,7 @@ const commit = util.getVersion(root);
|
||||
const linuxPackageRevision = Math.floor(new Date().getTime() / 1000);
|
||||
|
||||
function getDebPackageArch(arch) {
|
||||
return { x64: 'amd64', arm: 'armhf', arm64: "arm64" }[arch];
|
||||
return { x64: 'amd64', arm: 'armhf', arm64: 'arm64' }[arch];
|
||||
}
|
||||
|
||||
function prepareDebPackage(arch) {
|
||||
@@ -118,7 +118,7 @@ function getRpmBuildPath(rpmArch) {
|
||||
}
|
||||
|
||||
function getRpmPackageArch(arch) {
|
||||
return { x64: 'x86_64', arm: 'armhf', arm64: "arm64" }[arch];
|
||||
return { x64: 'x86_64', arm: 'armhf', arm64: 'arm64' }[arch];
|
||||
}
|
||||
|
||||
function prepareRpmPackage(arch) {
|
||||
|
||||
@@ -18,10 +18,7 @@ const fancyLog = require('fancy-log');
|
||||
const ansiColors = require('ansi-colors');
|
||||
|
||||
const root = path.dirname(path.dirname(__dirname));
|
||||
// {{SQL CARBON EDIT}}
|
||||
const quality = process.env['VSCODE_QUALITY'];
|
||||
const builtInExtensions = quality && quality === 'stable' ? require('../builtInExtensions.json') : require('../builtInExtensions-insiders.json');
|
||||
// {{SQL CARBON EDIT}} - END
|
||||
const builtInExtensions = require('../builtInExtensions.json');
|
||||
const controlFilePath = path.join(os.homedir(), '.vscode-oss-dev', 'extensions', 'control.json');
|
||||
const ENABLE_LOGGING = !process.env['VSCODE_BUILD_BUILTIN_EXTENSIONS_SILENCE_PLEASE'];
|
||||
|
||||
|
||||
59
build/lib/eslint/code-import-patterns.js
Normal file
59
build/lib/eslint/code-import-patterns.js
Normal file
@@ -0,0 +1,59 @@
|
||||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
const path_1 = require("path");
|
||||
const minimatch = require("minimatch");
|
||||
const utils_1 = require("./utils");
|
||||
module.exports = new class {
|
||||
constructor() {
|
||||
this.meta = {
|
||||
messages: {
|
||||
badImport: 'Imports violates \'{{restrictions}}\' restrictions. See https://github.com/microsoft/vscode/wiki/Source-Code-Organization'
|
||||
},
|
||||
docs: {
|
||||
url: 'https://github.com/microsoft/vscode/wiki/Source-Code-Organization'
|
||||
}
|
||||
};
|
||||
}
|
||||
create(context) {
|
||||
const configs = context.options;
|
||||
for (const config of configs) {
|
||||
if (minimatch(context.getFilename(), config.target)) {
|
||||
return utils_1.createImportRuleListener((node, value) => this._checkImport(context, config, node, value));
|
||||
}
|
||||
}
|
||||
return {};
|
||||
}
|
||||
_checkImport(context, config, node, path) {
|
||||
// resolve relative paths
|
||||
if (path[0] === '.') {
|
||||
path = path_1.join(context.getFilename(), path);
|
||||
}
|
||||
let restrictions;
|
||||
if (typeof config.restrictions === 'string') {
|
||||
restrictions = [config.restrictions];
|
||||
}
|
||||
else {
|
||||
restrictions = config.restrictions;
|
||||
}
|
||||
let matched = false;
|
||||
for (const pattern of restrictions) {
|
||||
if (minimatch(path, pattern)) {
|
||||
matched = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!matched) {
|
||||
// None of the restrictions matched
|
||||
context.report({
|
||||
loc: node.loc,
|
||||
messageId: 'badImport',
|
||||
data: {
|
||||
restrictions: restrictions.join(' or ')
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
75
build/lib/eslint/code-import-patterns.ts
Normal file
75
build/lib/eslint/code-import-patterns.ts
Normal file
@@ -0,0 +1,75 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as eslint from 'eslint';
|
||||
import { TSESTree } from '@typescript-eslint/experimental-utils';
|
||||
import { join } from 'path';
|
||||
import * as minimatch from 'minimatch';
|
||||
import { createImportRuleListener } from './utils';
|
||||
|
||||
interface ImportPatternsConfig {
|
||||
target: string;
|
||||
restrictions: string | string[];
|
||||
}
|
||||
|
||||
export = new class implements eslint.Rule.RuleModule {
|
||||
|
||||
readonly meta: eslint.Rule.RuleMetaData = {
|
||||
messages: {
|
||||
badImport: 'Imports violates \'{{restrictions}}\' restrictions. See https://github.com/microsoft/vscode/wiki/Source-Code-Organization'
|
||||
},
|
||||
docs: {
|
||||
url: 'https://github.com/microsoft/vscode/wiki/Source-Code-Organization'
|
||||
}
|
||||
};
|
||||
|
||||
create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener {
|
||||
|
||||
const configs = <ImportPatternsConfig[]>context.options;
|
||||
|
||||
for (const config of configs) {
|
||||
if (minimatch(context.getFilename(), config.target)) {
|
||||
return createImportRuleListener((node, value) => this._checkImport(context, config, node, value));
|
||||
}
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
private _checkImport(context: eslint.Rule.RuleContext, config: ImportPatternsConfig, node: TSESTree.Node, path: string) {
|
||||
|
||||
// resolve relative paths
|
||||
if (path[0] === '.') {
|
||||
path = join(context.getFilename(), path);
|
||||
}
|
||||
|
||||
let restrictions: string[];
|
||||
if (typeof config.restrictions === 'string') {
|
||||
restrictions = [config.restrictions];
|
||||
} else {
|
||||
restrictions = config.restrictions;
|
||||
}
|
||||
|
||||
let matched = false;
|
||||
for (const pattern of restrictions) {
|
||||
if (minimatch(path, pattern)) {
|
||||
matched = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!matched) {
|
||||
// None of the restrictions matched
|
||||
context.report({
|
||||
loc: node.loc,
|
||||
messageId: 'badImport',
|
||||
data: {
|
||||
restrictions: restrictions.join(' or ')
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
68
build/lib/eslint/code-layering.js
Normal file
68
build/lib/eslint/code-layering.js
Normal file
@@ -0,0 +1,68 @@
|
||||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
const path_1 = require("path");
|
||||
const utils_1 = require("./utils");
|
||||
module.exports = new class {
|
||||
constructor() {
|
||||
this.meta = {
|
||||
messages: {
|
||||
layerbreaker: 'Bad layering. You are not allowed to access {{from}} from here, allowed layers are: [{{allowed}}]'
|
||||
},
|
||||
docs: {
|
||||
url: 'https://github.com/microsoft/vscode/wiki/Source-Code-Organization'
|
||||
}
|
||||
};
|
||||
}
|
||||
create(context) {
|
||||
const fileDirname = path_1.dirname(context.getFilename());
|
||||
const parts = fileDirname.split(/\\|\//);
|
||||
const ruleArgs = context.options[0];
|
||||
let config;
|
||||
for (let i = parts.length - 1; i >= 0; i--) {
|
||||
if (ruleArgs[parts[i]]) {
|
||||
config = {
|
||||
allowed: new Set(ruleArgs[parts[i]]).add(parts[i]),
|
||||
disallowed: new Set()
|
||||
};
|
||||
Object.keys(ruleArgs).forEach(key => {
|
||||
if (!config.allowed.has(key)) {
|
||||
config.disallowed.add(key);
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!config) {
|
||||
// nothing
|
||||
return {};
|
||||
}
|
||||
return utils_1.createImportRuleListener((node, path) => {
|
||||
if (path[0] === '.') {
|
||||
path = path_1.join(path_1.dirname(context.getFilename()), path);
|
||||
}
|
||||
const parts = path_1.dirname(path).split(/\\|\//);
|
||||
for (let i = parts.length - 1; i >= 0; i--) {
|
||||
const part = parts[i];
|
||||
if (config.allowed.has(part)) {
|
||||
// GOOD - same layer
|
||||
break;
|
||||
}
|
||||
if (config.disallowed.has(part)) {
|
||||
// BAD - wrong layer
|
||||
context.report({
|
||||
loc: node.loc,
|
||||
messageId: 'layerbreaker',
|
||||
data: {
|
||||
from: part,
|
||||
allowed: [...config.allowed.keys()].join(', ')
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
83
build/lib/eslint/code-layering.ts
Normal file
83
build/lib/eslint/code-layering.ts
Normal file
@@ -0,0 +1,83 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as eslint from 'eslint';
|
||||
import { join, dirname } from 'path';
|
||||
import { createImportRuleListener } from './utils';
|
||||
|
||||
type Config = {
|
||||
allowed: Set<string>;
|
||||
disallowed: Set<string>;
|
||||
};
|
||||
|
||||
export = new class implements eslint.Rule.RuleModule {
|
||||
|
||||
readonly meta: eslint.Rule.RuleMetaData = {
|
||||
messages: {
|
||||
layerbreaker: 'Bad layering. You are not allowed to access {{from}} from here, allowed layers are: [{{allowed}}]'
|
||||
},
|
||||
docs: {
|
||||
url: 'https://github.com/microsoft/vscode/wiki/Source-Code-Organization'
|
||||
}
|
||||
};
|
||||
|
||||
create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener {
|
||||
|
||||
const fileDirname = dirname(context.getFilename());
|
||||
const parts = fileDirname.split(/\\|\//);
|
||||
const ruleArgs = <Record<string, string[]>>context.options[0];
|
||||
|
||||
let config: Config | undefined;
|
||||
for (let i = parts.length - 1; i >= 0; i--) {
|
||||
if (ruleArgs[parts[i]]) {
|
||||
config = {
|
||||
allowed: new Set(ruleArgs[parts[i]]).add(parts[i]),
|
||||
disallowed: new Set()
|
||||
};
|
||||
Object.keys(ruleArgs).forEach(key => {
|
||||
if (!config!.allowed.has(key)) {
|
||||
config!.disallowed.add(key);
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!config) {
|
||||
// nothing
|
||||
return {};
|
||||
}
|
||||
|
||||
return createImportRuleListener((node, path) => {
|
||||
if (path[0] === '.') {
|
||||
path = join(dirname(context.getFilename()), path);
|
||||
}
|
||||
|
||||
const parts = dirname(path).split(/\\|\//);
|
||||
for (let i = parts.length - 1; i >= 0; i--) {
|
||||
const part = parts[i];
|
||||
|
||||
if (config!.allowed.has(part)) {
|
||||
// GOOD - same layer
|
||||
break;
|
||||
}
|
||||
|
||||
if (config!.disallowed.has(part)) {
|
||||
// BAD - wrong layer
|
||||
context.report({
|
||||
loc: node.loc,
|
||||
messageId: 'layerbreaker',
|
||||
data: {
|
||||
from: part,
|
||||
allowed: [...config!.allowed.keys()].join(', ')
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
38
build/lib/eslint/code-no-nls-in-standalone-editor.js
Normal file
38
build/lib/eslint/code-no-nls-in-standalone-editor.js
Normal file
@@ -0,0 +1,38 @@
|
||||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
const path_1 = require("path");
|
||||
const utils_1 = require("./utils");
|
||||
module.exports = new class NoNlsInStandaloneEditorRule {
|
||||
constructor() {
|
||||
this.meta = {
|
||||
messages: {
|
||||
noNls: 'Not allowed to import vs/nls in standalone editor modules. Use standaloneStrings.ts'
|
||||
}
|
||||
};
|
||||
}
|
||||
create(context) {
|
||||
const fileName = context.getFilename();
|
||||
if (/vs(\/|\\)editor(\/|\\)standalone(\/|\\)/.test(fileName)
|
||||
|| /vs(\/|\\)editor(\/|\\)common(\/|\\)standalone(\/|\\)/.test(fileName)
|
||||
|| /vs(\/|\\)editor(\/|\\)editor.api/.test(fileName)
|
||||
|| /vs(\/|\\)editor(\/|\\)editor.main/.test(fileName)
|
||||
|| /vs(\/|\\)editor(\/|\\)editor.worker/.test(fileName)) {
|
||||
return utils_1.createImportRuleListener((node, path) => {
|
||||
// resolve relative paths
|
||||
if (path[0] === '.') {
|
||||
path = path_1.join(context.getFilename(), path);
|
||||
}
|
||||
if (/vs(\/|\\)nls/.test(path)) {
|
||||
context.report({
|
||||
loc: node.loc,
|
||||
messageId: 'noNls'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
return {};
|
||||
}
|
||||
};
|
||||
48
build/lib/eslint/code-no-nls-in-standalone-editor.ts
Normal file
48
build/lib/eslint/code-no-nls-in-standalone-editor.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as eslint from 'eslint';
|
||||
import { join } from 'path';
|
||||
import { createImportRuleListener } from './utils';
|
||||
|
||||
export = new class NoNlsInStandaloneEditorRule implements eslint.Rule.RuleModule {
|
||||
|
||||
readonly meta: eslint.Rule.RuleMetaData = {
|
||||
messages: {
|
||||
noNls: 'Not allowed to import vs/nls in standalone editor modules. Use standaloneStrings.ts'
|
||||
}
|
||||
};
|
||||
|
||||
create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener {
|
||||
|
||||
const fileName = context.getFilename();
|
||||
if (
|
||||
/vs(\/|\\)editor(\/|\\)standalone(\/|\\)/.test(fileName)
|
||||
|| /vs(\/|\\)editor(\/|\\)common(\/|\\)standalone(\/|\\)/.test(fileName)
|
||||
|| /vs(\/|\\)editor(\/|\\)editor.api/.test(fileName)
|
||||
|| /vs(\/|\\)editor(\/|\\)editor.main/.test(fileName)
|
||||
|| /vs(\/|\\)editor(\/|\\)editor.worker/.test(fileName)
|
||||
) {
|
||||
return createImportRuleListener((node, path) => {
|
||||
// resolve relative paths
|
||||
if (path[0] === '.') {
|
||||
path = join(context.getFilename(), path);
|
||||
}
|
||||
|
||||
if (
|
||||
/vs(\/|\\)nls/.test(path)
|
||||
) {
|
||||
context.report({
|
||||
loc: node.loc,
|
||||
messageId: 'noNls'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return {};
|
||||
}
|
||||
};
|
||||
|
||||
41
build/lib/eslint/code-no-standalone-editor.js
Normal file
41
build/lib/eslint/code-no-standalone-editor.js
Normal file
@@ -0,0 +1,41 @@
|
||||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
const path_1 = require("path");
|
||||
const utils_1 = require("./utils");
|
||||
module.exports = new class NoNlsInStandaloneEditorRule {
|
||||
constructor() {
|
||||
this.meta = {
|
||||
messages: {
|
||||
badImport: 'Not allowed to import standalone editor modules.'
|
||||
},
|
||||
docs: {
|
||||
url: 'https://github.com/microsoft/vscode/wiki/Source-Code-Organization'
|
||||
}
|
||||
};
|
||||
}
|
||||
create(context) {
|
||||
if (/vs(\/|\\)editor/.test(context.getFilename())) {
|
||||
// the vs/editor folder is allowed to use the standalone editor
|
||||
return {};
|
||||
}
|
||||
return utils_1.createImportRuleListener((node, path) => {
|
||||
// resolve relative paths
|
||||
if (path[0] === '.') {
|
||||
path = path_1.join(context.getFilename(), path);
|
||||
}
|
||||
if (/vs(\/|\\)editor(\/|\\)standalone(\/|\\)/.test(path)
|
||||
|| /vs(\/|\\)editor(\/|\\)common(\/|\\)standalone(\/|\\)/.test(path)
|
||||
|| /vs(\/|\\)editor(\/|\\)editor.api/.test(path)
|
||||
|| /vs(\/|\\)editor(\/|\\)editor.main/.test(path)
|
||||
|| /vs(\/|\\)editor(\/|\\)editor.worker/.test(path)) {
|
||||
context.report({
|
||||
loc: node.loc,
|
||||
messageId: 'badImport'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
50
build/lib/eslint/code-no-standalone-editor.ts
Normal file
50
build/lib/eslint/code-no-standalone-editor.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as eslint from 'eslint';
|
||||
import { join } from 'path';
|
||||
import { createImportRuleListener } from './utils';
|
||||
|
||||
export = new class NoNlsInStandaloneEditorRule implements eslint.Rule.RuleModule {
|
||||
|
||||
readonly meta: eslint.Rule.RuleMetaData = {
|
||||
messages: {
|
||||
badImport: 'Not allowed to import standalone editor modules.'
|
||||
},
|
||||
docs: {
|
||||
url: 'https://github.com/microsoft/vscode/wiki/Source-Code-Organization'
|
||||
}
|
||||
};
|
||||
|
||||
create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener {
|
||||
|
||||
if (/vs(\/|\\)editor/.test(context.getFilename())) {
|
||||
// the vs/editor folder is allowed to use the standalone editor
|
||||
return {};
|
||||
}
|
||||
|
||||
return createImportRuleListener((node, path) => {
|
||||
|
||||
// resolve relative paths
|
||||
if (path[0] === '.') {
|
||||
path = join(context.getFilename(), path);
|
||||
}
|
||||
|
||||
if (
|
||||
/vs(\/|\\)editor(\/|\\)standalone(\/|\\)/.test(path)
|
||||
|| /vs(\/|\\)editor(\/|\\)common(\/|\\)standalone(\/|\\)/.test(path)
|
||||
|| /vs(\/|\\)editor(\/|\\)editor.api/.test(path)
|
||||
|| /vs(\/|\\)editor(\/|\\)editor.main/.test(path)
|
||||
|| /vs(\/|\\)editor(\/|\\)editor.worker/.test(path)
|
||||
) {
|
||||
context.report({
|
||||
loc: node.loc,
|
||||
messageId: 'badImport'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
111
build/lib/eslint/code-no-unexternalized-strings.js
Normal file
111
build/lib/eslint/code-no-unexternalized-strings.js
Normal file
@@ -0,0 +1,111 @@
|
||||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
var _a;
|
||||
const experimental_utils_1 = require("@typescript-eslint/experimental-utils");
|
||||
function isStringLiteral(node) {
|
||||
return !!node && node.type === experimental_utils_1.AST_NODE_TYPES.Literal && typeof node.value === 'string';
|
||||
}
|
||||
function isDoubleQuoted(node) {
|
||||
return node.raw[0] === '"' && node.raw[node.raw.length - 1] === '"';
|
||||
}
|
||||
module.exports = new (_a = class NoUnexternalizedStrings {
|
||||
constructor() {
|
||||
this.meta = {
|
||||
messages: {
|
||||
doubleQuoted: 'Only use double-quoted strings for externalized strings.',
|
||||
badKey: 'The key \'{{key}}\' doesn\'t conform to a valid localize identifier.',
|
||||
duplicateKey: 'Duplicate key \'{{key}}\' with different message value.',
|
||||
badMessage: 'Message argument to \'{{message}}\' must be a string literal.'
|
||||
}
|
||||
};
|
||||
}
|
||||
create(context) {
|
||||
const externalizedStringLiterals = new Map();
|
||||
const doubleQuotedStringLiterals = new Set();
|
||||
function collectDoubleQuotedStrings(node) {
|
||||
if (isStringLiteral(node) && isDoubleQuoted(node)) {
|
||||
doubleQuotedStringLiterals.add(node);
|
||||
}
|
||||
}
|
||||
function visitLocalizeCall(node) {
|
||||
// localize(key, message)
|
||||
const [keyNode, messageNode] = node.arguments;
|
||||
// (1)
|
||||
// extract key so that it can be checked later
|
||||
let key;
|
||||
if (isStringLiteral(keyNode)) {
|
||||
doubleQuotedStringLiterals.delete(keyNode); //todo@joh reconsider
|
||||
key = keyNode.value;
|
||||
}
|
||||
else if (keyNode.type === experimental_utils_1.AST_NODE_TYPES.ObjectExpression) {
|
||||
for (let property of keyNode.properties) {
|
||||
if (property.type === experimental_utils_1.AST_NODE_TYPES.Property && !property.computed) {
|
||||
if (property.key.type === experimental_utils_1.AST_NODE_TYPES.Identifier && property.key.name === 'key') {
|
||||
if (isStringLiteral(property.value)) {
|
||||
doubleQuotedStringLiterals.delete(property.value); //todo@joh reconsider
|
||||
key = property.value.value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (typeof key === 'string') {
|
||||
let array = externalizedStringLiterals.get(key);
|
||||
if (!array) {
|
||||
array = [];
|
||||
externalizedStringLiterals.set(key, array);
|
||||
}
|
||||
array.push({ call: node, message: messageNode });
|
||||
}
|
||||
// (2)
|
||||
// remove message-argument from doubleQuoted list and make
|
||||
// sure it is a string-literal
|
||||
doubleQuotedStringLiterals.delete(messageNode);
|
||||
if (!isStringLiteral(messageNode)) {
|
||||
context.report({
|
||||
loc: messageNode.loc,
|
||||
messageId: 'badMessage',
|
||||
data: { message: context.getSourceCode().getText(node) }
|
||||
});
|
||||
}
|
||||
}
|
||||
function reportBadStringsAndBadKeys() {
|
||||
// (1)
|
||||
// report all strings that are in double quotes
|
||||
for (const node of doubleQuotedStringLiterals) {
|
||||
context.report({ loc: node.loc, messageId: 'doubleQuoted' });
|
||||
}
|
||||
for (const [key, values] of externalizedStringLiterals) {
|
||||
// (2)
|
||||
// report all invalid NLS keys
|
||||
if (!key.match(NoUnexternalizedStrings._rNlsKeys)) {
|
||||
for (let value of values) {
|
||||
context.report({ loc: value.call.loc, messageId: 'badKey', data: { key } });
|
||||
}
|
||||
}
|
||||
// (2)
|
||||
// report all invalid duplicates (same key, different message)
|
||||
if (values.length > 1) {
|
||||
for (let i = 1; i < values.length; i++) {
|
||||
if (context.getSourceCode().getText(values[i - 1].message) !== context.getSourceCode().getText(values[i].message)) {
|
||||
context.report({ loc: values[i].call.loc, messageId: 'duplicateKey', data: { key } });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return {
|
||||
['Literal']: (node) => collectDoubleQuotedStrings(node),
|
||||
['ExpressionStatement[directive] Literal:exit']: (node) => doubleQuotedStringLiterals.delete(node),
|
||||
['CallExpression[callee.type="MemberExpression"][callee.object.name="nls"][callee.property.name="localize"]:exit']: (node) => visitLocalizeCall(node),
|
||||
['CallExpression[callee.name="localize"][arguments.length>=2]:exit']: (node) => visitLocalizeCall(node),
|
||||
['Program:exit']: reportBadStringsAndBadKeys,
|
||||
};
|
||||
}
|
||||
},
|
||||
_a._rNlsKeys = /^[_a-zA-Z0-9][ .\-_a-zA-Z0-9]*$/,
|
||||
_a);
|
||||
126
build/lib/eslint/code-no-unexternalized-strings.ts
Normal file
126
build/lib/eslint/code-no-unexternalized-strings.ts
Normal file
@@ -0,0 +1,126 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as eslint from 'eslint';
|
||||
import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/experimental-utils';
|
||||
|
||||
function isStringLiteral(node: TSESTree.Node | null | undefined): node is TSESTree.StringLiteral {
|
||||
return !!node && node.type === AST_NODE_TYPES.Literal && typeof node.value === 'string';
|
||||
}
|
||||
|
||||
function isDoubleQuoted(node: TSESTree.StringLiteral): boolean {
|
||||
return node.raw[0] === '"' && node.raw[node.raw.length - 1] === '"';
|
||||
}
|
||||
|
||||
export = new class NoUnexternalizedStrings implements eslint.Rule.RuleModule {
|
||||
|
||||
private static _rNlsKeys = /^[_a-zA-Z0-9][ .\-_a-zA-Z0-9]*$/;
|
||||
|
||||
readonly meta: eslint.Rule.RuleMetaData = {
|
||||
messages: {
|
||||
doubleQuoted: 'Only use double-quoted strings for externalized strings.',
|
||||
badKey: 'The key \'{{key}}\' doesn\'t conform to a valid localize identifier.',
|
||||
duplicateKey: 'Duplicate key \'{{key}}\' with different message value.',
|
||||
badMessage: 'Message argument to \'{{message}}\' must be a string literal.'
|
||||
}
|
||||
};
|
||||
|
||||
create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener {
|
||||
|
||||
const externalizedStringLiterals = new Map<string, { call: TSESTree.CallExpression, message: TSESTree.Node }[]>();
|
||||
const doubleQuotedStringLiterals = new Set<TSESTree.Node>();
|
||||
|
||||
function collectDoubleQuotedStrings(node: TSESTree.Literal) {
|
||||
if (isStringLiteral(node) && isDoubleQuoted(node)) {
|
||||
doubleQuotedStringLiterals.add(node);
|
||||
}
|
||||
}
|
||||
|
||||
function visitLocalizeCall(node: TSESTree.CallExpression) {
|
||||
|
||||
// localize(key, message)
|
||||
const [keyNode, messageNode] = (<TSESTree.CallExpression>node).arguments;
|
||||
|
||||
// (1)
|
||||
// extract key so that it can be checked later
|
||||
let key: string | undefined;
|
||||
if (isStringLiteral(keyNode)) {
|
||||
doubleQuotedStringLiterals.delete(keyNode); //todo@joh reconsider
|
||||
key = keyNode.value;
|
||||
|
||||
} else if (keyNode.type === AST_NODE_TYPES.ObjectExpression) {
|
||||
for (let property of keyNode.properties) {
|
||||
if (property.type === AST_NODE_TYPES.Property && !property.computed) {
|
||||
if (property.key.type === AST_NODE_TYPES.Identifier && property.key.name === 'key') {
|
||||
if (isStringLiteral(property.value)) {
|
||||
doubleQuotedStringLiterals.delete(property.value); //todo@joh reconsider
|
||||
key = property.value.value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (typeof key === 'string') {
|
||||
let array = externalizedStringLiterals.get(key);
|
||||
if (!array) {
|
||||
array = [];
|
||||
externalizedStringLiterals.set(key, array);
|
||||
}
|
||||
array.push({ call: node, message: messageNode });
|
||||
}
|
||||
|
||||
// (2)
|
||||
// remove message-argument from doubleQuoted list and make
|
||||
// sure it is a string-literal
|
||||
doubleQuotedStringLiterals.delete(messageNode);
|
||||
if (!isStringLiteral(messageNode)) {
|
||||
context.report({
|
||||
loc: messageNode.loc,
|
||||
messageId: 'badMessage',
|
||||
data: { message: context.getSourceCode().getText(<any>node) }
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function reportBadStringsAndBadKeys() {
|
||||
// (1)
|
||||
// report all strings that are in double quotes
|
||||
for (const node of doubleQuotedStringLiterals) {
|
||||
context.report({ loc: node.loc, messageId: 'doubleQuoted' });
|
||||
}
|
||||
|
||||
for (const [key, values] of externalizedStringLiterals) {
|
||||
|
||||
// (2)
|
||||
// report all invalid NLS keys
|
||||
if (!key.match(NoUnexternalizedStrings._rNlsKeys)) {
|
||||
for (let value of values) {
|
||||
context.report({ loc: value.call.loc, messageId: 'badKey', data: { key } });
|
||||
}
|
||||
}
|
||||
|
||||
// (2)
|
||||
// report all invalid duplicates (same key, different message)
|
||||
if (values.length > 1) {
|
||||
for (let i = 1; i < values.length; i++) {
|
||||
if (context.getSourceCode().getText(<any>values[i - 1].message) !== context.getSourceCode().getText(<any>values[i].message)) {
|
||||
context.report({ loc: values[i].call.loc, messageId: 'duplicateKey', data: { key } });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
['Literal']: (node: any) => collectDoubleQuotedStrings(node),
|
||||
['ExpressionStatement[directive] Literal:exit']: (node: any) => doubleQuotedStringLiterals.delete(node),
|
||||
['CallExpression[callee.type="MemberExpression"][callee.object.name="nls"][callee.property.name="localize"]:exit']: (node: any) => visitLocalizeCall(node),
|
||||
['CallExpression[callee.name="localize"][arguments.length>=2]:exit']: (node: any) => visitLocalizeCall(node),
|
||||
['Program:exit']: reportBadStringsAndBadKeys,
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
145
build/lib/eslint/code-no-unused-expressions.js
Normal file
145
build/lib/eslint/code-no-unused-expressions.js
Normal file
@@ -0,0 +1,145 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
// FORKED FROM https://github.com/eslint/eslint/blob/b23ad0d789a909baf8d7c41a35bc53df932eaf30/lib/rules/no-unused-expressions.js
|
||||
// and added support for `OptionalCallExpression`, see https://github.com/facebook/create-react-app/issues/8107 and https://github.com/eslint/eslint/issues/12642
|
||||
|
||||
/**
|
||||
* @fileoverview Flag expressions in statement position that do not side effect
|
||||
* @author Michael Ficarra
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Rule Definition
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
module.exports = {
|
||||
meta: {
|
||||
type: 'suggestion',
|
||||
|
||||
docs: {
|
||||
description: 'disallow unused expressions',
|
||||
category: 'Best Practices',
|
||||
recommended: false,
|
||||
url: 'https://eslint.org/docs/rules/no-unused-expressions'
|
||||
},
|
||||
|
||||
schema: [
|
||||
{
|
||||
type: 'object',
|
||||
properties: {
|
||||
allowShortCircuit: {
|
||||
type: 'boolean',
|
||||
default: false
|
||||
},
|
||||
allowTernary: {
|
||||
type: 'boolean',
|
||||
default: false
|
||||
},
|
||||
allowTaggedTemplates: {
|
||||
type: 'boolean',
|
||||
default: false
|
||||
}
|
||||
},
|
||||
additionalProperties: false
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
create(context) {
|
||||
const config = context.options[0] || {},
|
||||
allowShortCircuit = config.allowShortCircuit || false,
|
||||
allowTernary = config.allowTernary || false,
|
||||
allowTaggedTemplates = config.allowTaggedTemplates || false;
|
||||
|
||||
// eslint-disable-next-line jsdoc/require-description
|
||||
/**
|
||||
* @param {ASTNode} node any node
|
||||
* @returns {boolean} whether the given node structurally represents a directive
|
||||
*/
|
||||
function looksLikeDirective(node) {
|
||||
return node.type === 'ExpressionStatement' &&
|
||||
node.expression.type === 'Literal' && typeof node.expression.value === 'string';
|
||||
}
|
||||
|
||||
// eslint-disable-next-line jsdoc/require-description
|
||||
/**
|
||||
* @param {Function} predicate ([a] -> Boolean) the function used to make the determination
|
||||
* @param {a[]} list the input list
|
||||
* @returns {a[]} the leading sequence of members in the given list that pass the given predicate
|
||||
*/
|
||||
function takeWhile(predicate, list) {
|
||||
for (let i = 0; i < list.length; ++i) {
|
||||
if (!predicate(list[i])) {
|
||||
return list.slice(0, i);
|
||||
}
|
||||
}
|
||||
return list.slice();
|
||||
}
|
||||
|
||||
// eslint-disable-next-line jsdoc/require-description
|
||||
/**
|
||||
* @param {ASTNode} node a Program or BlockStatement node
|
||||
* @returns {ASTNode[]} the leading sequence of directive nodes in the given node's body
|
||||
*/
|
||||
function directives(node) {
|
||||
return takeWhile(looksLikeDirective, node.body);
|
||||
}
|
||||
|
||||
// eslint-disable-next-line jsdoc/require-description
|
||||
/**
|
||||
* @param {ASTNode} node any node
|
||||
* @param {ASTNode[]} ancestors the given node's ancestors
|
||||
* @returns {boolean} whether the given node is considered a directive in its current position
|
||||
*/
|
||||
function isDirective(node, ancestors) {
|
||||
const parent = ancestors[ancestors.length - 1],
|
||||
grandparent = ancestors[ancestors.length - 2];
|
||||
|
||||
return (parent.type === 'Program' || parent.type === 'BlockStatement' &&
|
||||
(/Function/u.test(grandparent.type))) &&
|
||||
directives(parent).indexOf(node) >= 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines whether or not a given node is a valid expression. Recurses on short circuit eval and ternary nodes if enabled by flags.
|
||||
* @param {ASTNode} node any node
|
||||
* @returns {boolean} whether the given node is a valid expression
|
||||
*/
|
||||
function isValidExpression(node) {
|
||||
if (allowTernary) {
|
||||
|
||||
// Recursive check for ternary and logical expressions
|
||||
if (node.type === 'ConditionalExpression') {
|
||||
return isValidExpression(node.consequent) && isValidExpression(node.alternate);
|
||||
}
|
||||
}
|
||||
|
||||
if (allowShortCircuit) {
|
||||
if (node.type === 'LogicalExpression') {
|
||||
return isValidExpression(node.right);
|
||||
}
|
||||
}
|
||||
|
||||
if (allowTaggedTemplates && node.type === 'TaggedTemplateExpression') {
|
||||
return true;
|
||||
}
|
||||
|
||||
return /^(?:Assignment|OptionalCall|Call|New|Update|Yield|Await)Expression$/u.test(node.type) ||
|
||||
(node.type === 'UnaryExpression' && ['delete', 'void'].indexOf(node.operator) >= 0);
|
||||
}
|
||||
|
||||
return {
|
||||
ExpressionStatement(node) {
|
||||
if (!isValidExpression(node.expression) && !isDirective(node, context.getAncestors())) {
|
||||
context.report({ node, message: 'Expected an assignment or function call and instead saw an expression.' });
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
};
|
||||
57
build/lib/eslint/code-translation-remind.js
Normal file
57
build/lib/eslint/code-translation-remind.js
Normal file
@@ -0,0 +1,57 @@
|
||||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
var _a;
|
||||
const fs_1 = require("fs");
|
||||
const utils_1 = require("./utils");
|
||||
module.exports = new (_a = class TranslationRemind {
|
||||
constructor() {
|
||||
this.meta = {
|
||||
messages: {
|
||||
missing: 'Please add \'{{resource}}\' to ./build/lib/i18n.resources.json file to use translations here.'
|
||||
}
|
||||
};
|
||||
}
|
||||
create(context) {
|
||||
return utils_1.createImportRuleListener((node, path) => this._checkImport(context, node, path));
|
||||
}
|
||||
_checkImport(context, node, path) {
|
||||
if (path !== TranslationRemind.NLS_MODULE) {
|
||||
return;
|
||||
}
|
||||
const currentFile = context.getFilename();
|
||||
const matchService = currentFile.match(/vs\/workbench\/services\/\w+/);
|
||||
const matchPart = currentFile.match(/vs\/workbench\/contrib\/\w+/);
|
||||
if (!matchService && !matchPart) {
|
||||
return;
|
||||
}
|
||||
const resource = matchService ? matchService[0] : matchPart[0];
|
||||
let resourceDefined = false;
|
||||
let json;
|
||||
try {
|
||||
json = fs_1.readFileSync('./build/lib/i18n.resources.json', 'utf8');
|
||||
}
|
||||
catch (e) {
|
||||
console.error('[translation-remind rule]: File with resources to pull from Transifex was not found. Aborting translation resource check for newly defined workbench part/service.');
|
||||
return;
|
||||
}
|
||||
const workbenchResources = JSON.parse(json).workbench;
|
||||
workbenchResources.forEach((existingResource) => {
|
||||
if (existingResource.name === resource) {
|
||||
resourceDefined = true;
|
||||
return;
|
||||
}
|
||||
});
|
||||
if (!resourceDefined) {
|
||||
context.report({
|
||||
loc: node.loc,
|
||||
messageId: 'missing',
|
||||
data: { resource }
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
_a.NLS_MODULE = 'vs/nls',
|
||||
_a);
|
||||
67
build/lib/eslint/code-translation-remind.ts
Normal file
67
build/lib/eslint/code-translation-remind.ts
Normal file
@@ -0,0 +1,67 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as eslint from 'eslint';
|
||||
import { TSESTree } from '@typescript-eslint/experimental-utils';
|
||||
import { readFileSync } from 'fs';
|
||||
import { createImportRuleListener } from './utils';
|
||||
|
||||
|
||||
export = new class TranslationRemind implements eslint.Rule.RuleModule {
|
||||
|
||||
private static NLS_MODULE = 'vs/nls';
|
||||
|
||||
readonly meta: eslint.Rule.RuleMetaData = {
|
||||
messages: {
|
||||
missing: 'Please add \'{{resource}}\' to ./build/lib/i18n.resources.json file to use translations here.'
|
||||
}
|
||||
};
|
||||
|
||||
create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener {
|
||||
return createImportRuleListener((node, path) => this._checkImport(context, node, path));
|
||||
}
|
||||
|
||||
private _checkImport(context: eslint.Rule.RuleContext, node: TSESTree.Node, path: string) {
|
||||
|
||||
if (path !== TranslationRemind.NLS_MODULE) {
|
||||
return;
|
||||
}
|
||||
|
||||
const currentFile = context.getFilename();
|
||||
const matchService = currentFile.match(/vs\/workbench\/services\/\w+/);
|
||||
const matchPart = currentFile.match(/vs\/workbench\/contrib\/\w+/);
|
||||
if (!matchService && !matchPart) {
|
||||
return;
|
||||
}
|
||||
|
||||
const resource = matchService ? matchService[0] : matchPart![0];
|
||||
let resourceDefined = false;
|
||||
|
||||
let json;
|
||||
try {
|
||||
json = readFileSync('./build/lib/i18n.resources.json', 'utf8');
|
||||
} catch (e) {
|
||||
console.error('[translation-remind rule]: File with resources to pull from Transifex was not found. Aborting translation resource check for newly defined workbench part/service.');
|
||||
return;
|
||||
}
|
||||
const workbenchResources = JSON.parse(json).workbench;
|
||||
|
||||
workbenchResources.forEach((existingResource: any) => {
|
||||
if (existingResource.name === resource) {
|
||||
resourceDefined = true;
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
if (!resourceDefined) {
|
||||
context.report({
|
||||
loc: node.loc,
|
||||
messageId: 'missing',
|
||||
data: { resource }
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
36
build/lib/eslint/utils.js
Normal file
36
build/lib/eslint/utils.js
Normal file
@@ -0,0 +1,36 @@
|
||||
"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 });
|
||||
function createImportRuleListener(validateImport) {
|
||||
function _checkImport(node) {
|
||||
if (node && node.type === 'Literal' && typeof node.value === 'string') {
|
||||
validateImport(node, node.value);
|
||||
}
|
||||
}
|
||||
return {
|
||||
// import ??? from 'module'
|
||||
ImportDeclaration: (node) => {
|
||||
_checkImport(node.source);
|
||||
},
|
||||
// import('module').then(...) OR await import('module')
|
||||
['CallExpression[callee.type="Import"][arguments.length=1] > Literal']: (node) => {
|
||||
_checkImport(node);
|
||||
},
|
||||
// import foo = ...
|
||||
['TSImportEqualsDeclaration > TSExternalModuleReference > Literal']: (node) => {
|
||||
_checkImport(node);
|
||||
},
|
||||
// export ?? from 'module'
|
||||
ExportAllDeclaration: (node) => {
|
||||
_checkImport(node.source);
|
||||
},
|
||||
// export {foo} from 'module'
|
||||
ExportNamedDeclaration: (node) => {
|
||||
_checkImport(node.source);
|
||||
},
|
||||
};
|
||||
}
|
||||
exports.createImportRuleListener = createImportRuleListener;
|
||||
40
build/lib/eslint/utils.ts
Normal file
40
build/lib/eslint/utils.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as eslint from 'eslint';
|
||||
import { TSESTree } from '@typescript-eslint/experimental-utils';
|
||||
|
||||
export function createImportRuleListener(validateImport: (node: TSESTree.Literal, value: string) => any): eslint.Rule.RuleListener {
|
||||
|
||||
function _checkImport(node: TSESTree.Node | null) {
|
||||
if (node && node.type === 'Literal' && typeof node.value === 'string') {
|
||||
validateImport(node, node.value);
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
// import ??? from 'module'
|
||||
ImportDeclaration: (node: any) => {
|
||||
_checkImport((<TSESTree.ImportDeclaration>node).source);
|
||||
},
|
||||
// import('module').then(...) OR await import('module')
|
||||
['CallExpression[callee.type="Import"][arguments.length=1] > Literal']: (node: any) => {
|
||||
_checkImport(node);
|
||||
},
|
||||
// import foo = ...
|
||||
['TSImportEqualsDeclaration > TSExternalModuleReference > Literal']: (node: any) => {
|
||||
_checkImport(node);
|
||||
},
|
||||
// export ?? from 'module'
|
||||
ExportAllDeclaration: (node: any) => {
|
||||
_checkImport((<TSESTree.ExportAllDeclaration>node).source);
|
||||
},
|
||||
// export {foo} from 'module'
|
||||
ExportNamedDeclaration: (node: any) => {
|
||||
_checkImport((<TSESTree.ExportNamedDeclaration>node).source);
|
||||
},
|
||||
|
||||
};
|
||||
}
|
||||
35
build/lib/eslint/vscode-dts-create-func.js
Normal file
35
build/lib/eslint/vscode-dts-create-func.js
Normal file
@@ -0,0 +1,35 @@
|
||||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
const experimental_utils_1 = require("@typescript-eslint/experimental-utils");
|
||||
module.exports = new class ApiLiteralOrTypes {
|
||||
constructor() {
|
||||
this.meta = {
|
||||
docs: { url: 'https://github.com/microsoft/vscode/wiki/Extension-API-guidelines#creating-objects' },
|
||||
messages: { sync: '`createXYZ`-functions are constructor-replacements and therefore must return sync', }
|
||||
};
|
||||
}
|
||||
create(context) {
|
||||
return {
|
||||
['TSDeclareFunction Identifier[name=/create.*/]']: (node) => {
|
||||
var _a;
|
||||
const decl = node.parent;
|
||||
if (((_a = decl.returnType) === null || _a === void 0 ? void 0 : _a.typeAnnotation.type) !== experimental_utils_1.AST_NODE_TYPES.TSTypeReference) {
|
||||
return;
|
||||
}
|
||||
if (decl.returnType.typeAnnotation.typeName.type !== experimental_utils_1.AST_NODE_TYPES.Identifier) {
|
||||
return;
|
||||
}
|
||||
const ident = decl.returnType.typeAnnotation.typeName.name;
|
||||
if (ident === 'Promise' || ident === 'Thenable') {
|
||||
context.report({
|
||||
node,
|
||||
messageId: 'sync'
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
40
build/lib/eslint/vscode-dts-create-func.ts
Normal file
40
build/lib/eslint/vscode-dts-create-func.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as eslint from 'eslint';
|
||||
import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/experimental-utils';
|
||||
|
||||
export = new class ApiLiteralOrTypes implements eslint.Rule.RuleModule {
|
||||
|
||||
readonly meta: eslint.Rule.RuleMetaData = {
|
||||
docs: { url: 'https://github.com/microsoft/vscode/wiki/Extension-API-guidelines#creating-objects' },
|
||||
messages: { sync: '`createXYZ`-functions are constructor-replacements and therefore must return sync', }
|
||||
};
|
||||
|
||||
create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener {
|
||||
|
||||
return {
|
||||
['TSDeclareFunction Identifier[name=/create.*/]']: (node: any) => {
|
||||
|
||||
const decl = <TSESTree.FunctionDeclaration>(<TSESTree.Identifier>node).parent;
|
||||
|
||||
if (decl.returnType?.typeAnnotation.type !== AST_NODE_TYPES.TSTypeReference) {
|
||||
return;
|
||||
}
|
||||
if (decl.returnType.typeAnnotation.typeName.type !== AST_NODE_TYPES.Identifier) {
|
||||
return;
|
||||
}
|
||||
|
||||
const ident = decl.returnType.typeAnnotation.typeName.name;
|
||||
if (ident === 'Promise' || ident === 'Thenable') {
|
||||
context.report({
|
||||
node,
|
||||
messageId: 'sync'
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
81
build/lib/eslint/vscode-dts-event-naming.js
Normal file
81
build/lib/eslint/vscode-dts-event-naming.js
Normal file
@@ -0,0 +1,81 @@
|
||||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
var _a;
|
||||
const experimental_utils_1 = require("@typescript-eslint/experimental-utils");
|
||||
module.exports = new (_a = class ApiEventNaming {
|
||||
constructor() {
|
||||
this.meta = {
|
||||
docs: {
|
||||
url: 'https://github.com/microsoft/vscode/wiki/Extension-API-guidelines#event-naming'
|
||||
},
|
||||
messages: {
|
||||
naming: 'Event names must follow this patten: `on[Did|Will]<Verb><Subject>`',
|
||||
verb: 'Unknown verb \'{{verb}}\' - is this really a verb? Iff so, then add this verb to the configuration',
|
||||
subject: 'Unknown subject \'{{subject}}\' - This subject has not been used before but it should refer to something in the API',
|
||||
unknown: 'UNKNOWN event declaration, lint-rule needs tweaking'
|
||||
}
|
||||
};
|
||||
}
|
||||
create(context) {
|
||||
const config = context.options[0];
|
||||
const allowed = new Set(config.allowed);
|
||||
const verbs = new Set(config.verbs);
|
||||
return {
|
||||
['TSTypeAnnotation TSTypeReference Identifier[name="Event"]']: (node) => {
|
||||
var _a, _b;
|
||||
const def = (_b = (_a = node.parent) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.parent;
|
||||
let ident;
|
||||
if ((def === null || def === void 0 ? void 0 : def.type) === experimental_utils_1.AST_NODE_TYPES.Identifier) {
|
||||
ident = def;
|
||||
}
|
||||
else if (((def === null || def === void 0 ? void 0 : def.type) === experimental_utils_1.AST_NODE_TYPES.TSPropertySignature || (def === null || def === void 0 ? void 0 : def.type) === experimental_utils_1.AST_NODE_TYPES.ClassProperty) && def.key.type === experimental_utils_1.AST_NODE_TYPES.Identifier) {
|
||||
ident = def.key;
|
||||
}
|
||||
if (!ident) {
|
||||
// event on unknown structure...
|
||||
return context.report({
|
||||
node,
|
||||
message: 'unknown'
|
||||
});
|
||||
}
|
||||
if (allowed.has(ident.name)) {
|
||||
// configured exception
|
||||
return;
|
||||
}
|
||||
const match = ApiEventNaming._nameRegExp.exec(ident.name);
|
||||
if (!match) {
|
||||
context.report({
|
||||
node: ident,
|
||||
messageId: 'naming'
|
||||
});
|
||||
return;
|
||||
}
|
||||
// check that <verb> is spelled out (configured) as verb
|
||||
if (!verbs.has(match[2].toLowerCase())) {
|
||||
context.report({
|
||||
node: ident,
|
||||
messageId: 'verb',
|
||||
data: { verb: match[2] }
|
||||
});
|
||||
}
|
||||
// check that a subject (if present) has occurred
|
||||
if (match[3]) {
|
||||
const regex = new RegExp(match[3], 'ig');
|
||||
const parts = context.getSourceCode().getText().split(regex);
|
||||
if (parts.length < 3) {
|
||||
context.report({
|
||||
node: ident,
|
||||
messageId: 'subject',
|
||||
data: { subject: match[3] }
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
},
|
||||
_a._nameRegExp = /on(Did|Will)([A-Z][a-z]+)([A-Z][a-z]+)?/,
|
||||
_a);
|
||||
91
build/lib/eslint/vscode-dts-event-naming.ts
Normal file
91
build/lib/eslint/vscode-dts-event-naming.ts
Normal file
@@ -0,0 +1,91 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as eslint from 'eslint';
|
||||
import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/experimental-utils';
|
||||
|
||||
export = new class ApiEventNaming implements eslint.Rule.RuleModule {
|
||||
|
||||
private static _nameRegExp = /on(Did|Will)([A-Z][a-z]+)([A-Z][a-z]+)?/;
|
||||
|
||||
readonly meta: eslint.Rule.RuleMetaData = {
|
||||
docs: {
|
||||
url: 'https://github.com/microsoft/vscode/wiki/Extension-API-guidelines#event-naming'
|
||||
},
|
||||
messages: {
|
||||
naming: 'Event names must follow this patten: `on[Did|Will]<Verb><Subject>`',
|
||||
verb: 'Unknown verb \'{{verb}}\' - is this really a verb? Iff so, then add this verb to the configuration',
|
||||
subject: 'Unknown subject \'{{subject}}\' - This subject has not been used before but it should refer to something in the API',
|
||||
unknown: 'UNKNOWN event declaration, lint-rule needs tweaking'
|
||||
}
|
||||
};
|
||||
|
||||
create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener {
|
||||
|
||||
const config = <{ allowed: string[], verbs: string[] }>context.options[0];
|
||||
const allowed = new Set(config.allowed);
|
||||
const verbs = new Set(config.verbs);
|
||||
|
||||
return {
|
||||
['TSTypeAnnotation TSTypeReference Identifier[name="Event"]']: (node: any) => {
|
||||
|
||||
const def = (<TSESTree.Identifier>node).parent?.parent?.parent;
|
||||
let ident: TSESTree.Identifier | undefined;
|
||||
|
||||
if (def?.type === AST_NODE_TYPES.Identifier) {
|
||||
ident = def;
|
||||
|
||||
} else if ((def?.type === AST_NODE_TYPES.TSPropertySignature || def?.type === AST_NODE_TYPES.ClassProperty) && def.key.type === AST_NODE_TYPES.Identifier) {
|
||||
ident = def.key;
|
||||
}
|
||||
|
||||
if (!ident) {
|
||||
// event on unknown structure...
|
||||
return context.report({
|
||||
node,
|
||||
message: 'unknown'
|
||||
});
|
||||
}
|
||||
|
||||
if (allowed.has(ident.name)) {
|
||||
// configured exception
|
||||
return;
|
||||
}
|
||||
|
||||
const match = ApiEventNaming._nameRegExp.exec(ident.name);
|
||||
if (!match) {
|
||||
context.report({
|
||||
node: ident,
|
||||
messageId: 'naming'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// check that <verb> is spelled out (configured) as verb
|
||||
if (!verbs.has(match[2].toLowerCase())) {
|
||||
context.report({
|
||||
node: ident,
|
||||
messageId: 'verb',
|
||||
data: { verb: match[2] }
|
||||
});
|
||||
}
|
||||
|
||||
// check that a subject (if present) has occurred
|
||||
if (match[3]) {
|
||||
const regex = new RegExp(match[3], 'ig');
|
||||
const parts = context.getSourceCode().getText().split(regex);
|
||||
if (parts.length < 3) {
|
||||
context.report({
|
||||
node: ident,
|
||||
messageId: 'subject',
|
||||
data: { subject: match[3] }
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
30
build/lib/eslint/vscode-dts-interface-naming.js
Normal file
30
build/lib/eslint/vscode-dts-interface-naming.js
Normal file
@@ -0,0 +1,30 @@
|
||||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
var _a;
|
||||
module.exports = new (_a = class ApiInterfaceNaming {
|
||||
constructor() {
|
||||
this.meta = {
|
||||
messages: {
|
||||
naming: 'Interfaces must not be prefixed with uppercase `I`',
|
||||
}
|
||||
};
|
||||
}
|
||||
create(context) {
|
||||
return {
|
||||
['TSInterfaceDeclaration Identifier']: (node) => {
|
||||
const name = node.name;
|
||||
if (ApiInterfaceNaming._nameRegExp.test(name)) {
|
||||
context.report({
|
||||
node,
|
||||
messageId: 'naming'
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
},
|
||||
_a._nameRegExp = /I[A-Z]/,
|
||||
_a);
|
||||
35
build/lib/eslint/vscode-dts-interface-naming.ts
Normal file
35
build/lib/eslint/vscode-dts-interface-naming.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as eslint from 'eslint';
|
||||
import { TSESTree } from '@typescript-eslint/experimental-utils';
|
||||
|
||||
export = new class ApiInterfaceNaming implements eslint.Rule.RuleModule {
|
||||
|
||||
private static _nameRegExp = /I[A-Z]/;
|
||||
|
||||
readonly meta: eslint.Rule.RuleMetaData = {
|
||||
messages: {
|
||||
naming: 'Interfaces must not be prefixed with uppercase `I`',
|
||||
}
|
||||
};
|
||||
|
||||
create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener {
|
||||
|
||||
return {
|
||||
['TSInterfaceDeclaration Identifier']: (node: any) => {
|
||||
|
||||
const name = (<TSESTree.Identifier>node).name;
|
||||
if (ApiInterfaceNaming._nameRegExp.test(name)) {
|
||||
context.report({
|
||||
node,
|
||||
messageId: 'naming'
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
23
build/lib/eslint/vscode-dts-literal-or-types.js
Normal file
23
build/lib/eslint/vscode-dts-literal-or-types.js
Normal file
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
module.exports = new class ApiLiteralOrTypes {
|
||||
constructor() {
|
||||
this.meta = {
|
||||
docs: { url: 'https://github.com/microsoft/vscode/wiki/Extension-API-guidelines#enums' },
|
||||
messages: { useEnum: 'Use enums, not literal-or-types', }
|
||||
};
|
||||
}
|
||||
create(context) {
|
||||
return {
|
||||
['TSTypeAnnotation TSUnionType TSLiteralType']: (node) => {
|
||||
context.report({
|
||||
node: node,
|
||||
messageId: 'useEnum'
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
25
build/lib/eslint/vscode-dts-literal-or-types.ts
Normal file
25
build/lib/eslint/vscode-dts-literal-or-types.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as eslint from 'eslint';
|
||||
|
||||
export = new class ApiLiteralOrTypes implements eslint.Rule.RuleModule {
|
||||
|
||||
readonly meta: eslint.Rule.RuleMetaData = {
|
||||
docs: { url: 'https://github.com/microsoft/vscode/wiki/Extension-API-guidelines#enums' },
|
||||
messages: { useEnum: 'Use enums, not literal-or-types', }
|
||||
};
|
||||
|
||||
create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener {
|
||||
return {
|
||||
['TSTypeAnnotation TSUnionType TSLiteralType']: (node: any) => {
|
||||
context.report({
|
||||
node: node,
|
||||
messageId: 'useEnum'
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
@@ -27,6 +27,7 @@ const util = require('./util');
|
||||
const root = path.dirname(path.dirname(__dirname));
|
||||
const commit = util.getVersion(root);
|
||||
const sourceMappingURLBase = `https://ticino.blob.core.windows.net/sourcemaps/${commit}`;
|
||||
const product = require('../../product.json');
|
||||
function fromLocal(extensionPath) {
|
||||
const webpackFilename = path.join(extensionPath, 'extension.webpack.config.js');
|
||||
const input = fs.existsSync(webpackFilename)
|
||||
@@ -185,8 +186,8 @@ const excludedExtensions = [
|
||||
'vscode-test-resolver',
|
||||
'ms-vscode.node-debug',
|
||||
'ms-vscode.node-debug2',
|
||||
// {{SQL CARBON EDIT}}
|
||||
'integration-tests'
|
||||
'integration-tests',
|
||||
'ms.vscode.js-debug-nightly'
|
||||
];
|
||||
// {{SQL CARBON EDIT}}
|
||||
const externalExtensions = [
|
||||
@@ -204,15 +205,16 @@ const externalExtensions = [
|
||||
'cms',
|
||||
'query-history',
|
||||
'liveshare',
|
||||
'sql-database-projects'
|
||||
'sql-database-projects',
|
||||
'machine-learning-services'
|
||||
];
|
||||
// extensions that require a rebuild since they have native parts
|
||||
const rebuildExtensions = [
|
||||
'big-data-cluster',
|
||||
'mssql'
|
||||
];
|
||||
const builtInExtensions = process.env['VSCODE_QUALITY'] === 'stable' ? require('../builtInExtensions.json') : require('../builtInExtensions-insiders.json');
|
||||
// {{SQL CARBON EDIT}} - End
|
||||
const builtInExtensions = require('../builtInExtensions.json')
|
||||
.filter(({ forQualities }) => { var _a; return !product.quality || ((_a = forQualities === null || forQualities === void 0 ? void 0 : forQualities.includes) === null || _a === void 0 ? void 0 : _a.call(forQualities, product.quality)) !== false; });
|
||||
function packageLocalExtensionsStream() {
|
||||
const localExtensionDescriptions = glob.sync('extensions/*/package.json')
|
||||
.map(manifestPath => {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user