diff --git a/.gitignore b/.gitignore index c0459c8604323..123b3567059df 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ npm-debug.log Thumbs.db node_modules/ .build/ +.vscode/extensions/**/out/ extensions/**/dist/ /out*/ /extensions/**/out/ diff --git a/build/gulpfile.extensions.js b/build/gulpfile.extensions.js index 579a62dbbbbe6..32a66abfbc2a0 100644 --- a/build/gulpfile.extensions.js +++ b/build/gulpfile.extensions.js @@ -22,74 +22,70 @@ const commit = getVersion(root); const plumber = require('gulp-plumber'); const ext = require('./lib/extensions'); -const extensionsPath = path.join(path.dirname(__dirname), 'extensions'); - // To save 250ms for each gulp startup, we are caching the result here // const compilations = glob.sync('**/tsconfig.json', { // cwd: extensionsPath, // ignore: ['**/out/**', '**/node_modules/**'] // }); const compilations = [ - 'authentication-proxy/tsconfig.json', - 'configuration-editing/build/tsconfig.json', - 'configuration-editing/tsconfig.json', - 'css-language-features/client/tsconfig.json', - 'css-language-features/server/tsconfig.json', - 'debug-auto-launch/tsconfig.json', - 'debug-server-ready/tsconfig.json', - 'emmet/tsconfig.json', - 'extension-editing/tsconfig.json', - 'git/tsconfig.json', - 'git-base/tsconfig.json', - 'github-authentication/tsconfig.json', - 'github/tsconfig.json', - 'grunt/tsconfig.json', - 'gulp/tsconfig.json', - 'html-language-features/client/tsconfig.json', - 'html-language-features/server/tsconfig.json', - 'ipynb/tsconfig.json', - 'jake/tsconfig.json', - 'json-language-features/client/tsconfig.json', - 'json-language-features/server/tsconfig.json', - 'markdown-language-features/preview-src/tsconfig.json', - 'markdown-language-features/server/tsconfig.json', - 'markdown-language-features/tsconfig.json', - 'markdown-math/tsconfig.json', - 'media-preview/tsconfig.json', - 'merge-conflict/tsconfig.json', - 'microsoft-authentication/tsconfig.json', - 'notebook-renderers/tsconfig.json', - 'npm/tsconfig.json', - 'php-language-features/tsconfig.json', - 'search-result/tsconfig.json', - 'references-view/tsconfig.json', - 'simple-browser/tsconfig.json', - 'tunnel-forwarding/tsconfig.json', - 'typescript-language-features/test-workspace/tsconfig.json', - 'typescript-language-features/web/tsconfig.json', - 'typescript-language-features/tsconfig.json', - 'vscode-api-tests/tsconfig.json', - 'vscode-colorize-tests/tsconfig.json', - 'vscode-test-resolver/tsconfig.json' + 'extensions/configuration-editing/tsconfig.json', + 'extensions/css-language-features/client/tsconfig.json', + 'extensions/css-language-features/server/tsconfig.json', + 'extensions/debug-auto-launch/tsconfig.json', + 'extensions/debug-server-ready/tsconfig.json', + 'extensions/emmet/tsconfig.json', + 'extensions/extension-editing/tsconfig.json', + 'extensions/git/tsconfig.json', + 'extensions/git-base/tsconfig.json', + 'extensions/github/tsconfig.json', + 'extensions/github-authentication/tsconfig.json', + 'extensions/grunt/tsconfig.json', + 'extensions/gulp/tsconfig.json', + 'extensions/html-language-features/client/tsconfig.json', + 'extensions/html-language-features/server/tsconfig.json', + 'extensions/ipynb/tsconfig.json', + 'extensions/jake/tsconfig.json', + 'extensions/json-language-features/client/tsconfig.json', + 'extensions/json-language-features/server/tsconfig.json', + 'extensions/markdown-language-features/preview-src/tsconfig.json', + 'extensions/markdown-language-features/server/tsconfig.json', + 'extensions/markdown-language-features/tsconfig.json', + 'extensions/markdown-math/tsconfig.json', + 'extensions/media-preview/tsconfig.json', + 'extensions/merge-conflict/tsconfig.json', + 'extensions/microsoft-authentication/tsconfig.json', + 'extensions/notebook-renderers/tsconfig.json', + 'extensions/npm/tsconfig.json', + 'extensions/php-language-features/tsconfig.json', + 'extensions/references-view/tsconfig.json', + 'extensions/search-result/tsconfig.json', + 'extensions/simple-browser/tsconfig.json', + 'extensions/tunnel-forwarding/tsconfig.json', + 'extensions/typescript-language-features/test-workspace/tsconfig.json', + 'extensions/typescript-language-features/web/tsconfig.json', + 'extensions/typescript-language-features/tsconfig.json', + 'extensions/vscode-api-tests/tsconfig.json', + 'extensions/vscode-colorize-tests/tsconfig.json', + 'extensions/vscode-test-resolver/tsconfig.json' ]; const getBaseUrl = out => `https://ticino.blob.core.windows.net/sourcemaps/${commit}/${out}`; const tasks = compilations.map(function (tsconfigFile) { - const absolutePath = path.join(extensionsPath, tsconfigFile); - const relativeDirname = path.dirname(tsconfigFile); + const absolutePath = path.join(root, tsconfigFile); + const relativeDirname = path.dirname(tsconfigFile.replace(/^(.*\/)?extensions\//i, '')); const overrideOptions = {}; overrideOptions.sourceMap = true; const name = relativeDirname.replace(/\//g, '-'); - const root = path.join('extensions', relativeDirname); - const srcBase = path.join(root, 'src'); + const srcRoot = path.dirname(tsconfigFile); + const srcBase = path.join(srcRoot, 'src'); const src = path.join(srcBase, '**'); - const srcOpts = { cwd: path.dirname(__dirname), base: srcBase }; + const srcOpts = { cwd: root, base: srcBase, dot: true }; - const out = path.join(root, 'out'); + const out = path.join(srcRoot, 'out'); const baseUrl = getBaseUrl(out); let headerId, headerOut; @@ -116,7 +112,7 @@ const tasks = compilations.map(function (tsconfigFile) { const pipeline = function () { const input = es.through(); - const tsFilter = filter(['**/*.ts', '!**/lib/lib*.d.ts', '!**/node_modules/**'], { restore: true }); + const tsFilter = filter(['**/*.ts', '!**/lib/lib*.d.ts', '!**/node_modules/**'], { restore: true, dot: true }); const output = input .pipe(plumber({ errorHandler: function (err) { @@ -140,7 +136,7 @@ const tasks = compilations.map(function (tsconfigFile) { .pipe(tsFilter.restore) .pipe(build ? nlsDev.bundleMetaDataFiles(headerId, headerOut) : es.through()) // Filter out *.nls.json file. We needed them only to bundle meta data file. - .pipe(filter(['**', '!**/*.nls.json'])) + .pipe(filter(['**', '!**/*.nls.json'], { dot: true })) .pipe(reporter.end(emitError)); return es.duplex(input, output); @@ -272,6 +268,7 @@ exports.watchWebExtensionsTask = watchWebExtensionsTask; * @param {boolean} isWatch */ async function buildWebExtensions(isWatch) { + const extensionsPath = path.join(root, 'extensions'); const webpackConfigLocations = await nodeUtil.promisify(glob)( path.join(extensionsPath, '**', 'extension-browser.webpack.config.js'), { ignore: ['**/node_modules'] }