-
Notifications
You must be signed in to change notification settings - Fork 29.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adopt the MSAL broker to talk to the OS for Microsoft auth #233739
base: main
Are you sure you want to change the base?
Changes from all commits
9ac92eb
8b80da7
ed70558
afb68b3
89af916
6674d50
bcb892a
002b628
d0edf91
329e5a6
faedfaf
087a4e0
12e1e57
fa88ced
abcb768
0cdb01b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,7 +27,7 @@ const File = require('vinyl'); | |
const fs = require('fs'); | ||
const glob = require('glob'); | ||
const { compileBuildTask } = require('./gulpfile.compile'); | ||
const { compileExtensionsBuildTask, compileExtensionMediaBuildTask } = require('./gulpfile.extensions'); | ||
const { cleanExtensionsBuildTask, compileNonNativeExtensionsBuildTask, compileNativeExtensionsBuildTask, compileExtensionMediaBuildTask } = require('./gulpfile.extensions'); | ||
const { vscodeWebResourceIncludes, createVSCodeWebFileContentMapper } = require('./gulpfile.vscode.web'); | ||
const cp = require('child_process'); | ||
const log = require('fancy-log'); | ||
|
@@ -468,6 +468,7 @@ function tweakProductForServerWeb(product) { | |
const destinationFolderName = `vscode-${type}${dashed(platform)}${dashed(arch)}`; | ||
|
||
const serverTaskCI = task.define(`vscode-${type}${dashed(platform)}${dashed(arch)}${dashed(minified)}-ci`, task.series( | ||
compileNativeExtensionsBuildTask, | ||
gulp.task(`node-${platform}-${arch}`), | ||
util.rimraf(path.join(BUILD_ROOT, destinationFolderName)), | ||
packageTask(type, platform, arch, sourceFolderName, destinationFolderName) | ||
|
@@ -476,7 +477,8 @@ function tweakProductForServerWeb(product) { | |
|
||
const serverTask = task.define(`vscode-${type}${dashed(platform)}${dashed(arch)}${dashed(minified)}`, task.series( | ||
compileBuildTask, | ||
compileExtensionsBuildTask, | ||
cleanExtensionsBuildTask, | ||
compileNonNativeExtensionsBuildTask, | ||
compileExtensionMediaBuildTask, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't we want There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It does build all targets. We build the non-native ones here, and then the native ones in the |
||
minified ? minifyTask : bundleTask, | ||
serverTaskCI | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -31,7 +31,7 @@ const { config } = require('./lib/electron'); | |||||
const createAsar = require('./lib/asar').createAsar; | ||||||
const minimist = require('minimist'); | ||||||
const { compileBuildTask } = require('./gulpfile.compile'); | ||||||
const { compileExtensionsBuildTask, compileExtensionMediaBuildTask } = require('./gulpfile.extensions'); | ||||||
const { compileNonNativeExtensionsBuildTask, compileNativeExtensionsBuildTask, compileAllExtensionsBuildTask, compileExtensionMediaBuildTask, cleanExtensionsBuildTask } = require('./gulpfile.extensions'); | ||||||
const { promisify } = require('util'); | ||||||
const glob = promisify(require('glob')); | ||||||
const rcedit = promisify(require('rcedit')); | ||||||
|
@@ -487,6 +487,7 @@ BUILD_TARGETS.forEach(buildTarget => { | |||||
const destinationFolderName = `VSCode${dashed(platform)}${dashed(arch)}`; | ||||||
|
||||||
const tasks = [ | ||||||
compileNativeExtensionsBuildTask, | ||||||
util.rimraf(path.join(buildRoot, destinationFolderName)), | ||||||
packageTask(platform, arch, sourceFolderName, destinationFolderName, opts) | ||||||
]; | ||||||
|
@@ -500,7 +501,8 @@ BUILD_TARGETS.forEach(buildTarget => { | |||||
|
||||||
const vscodeTask = task.define(`vscode${dashed(platform)}${dashed(arch)}${dashed(minified)}`, task.series( | ||||||
compileBuildTask, | ||||||
compileExtensionsBuildTask, | ||||||
cleanExtensionsBuildTask, | ||||||
compileNonNativeExtensionsBuildTask, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With this suggestion, we will be building the native ones twice. I separated them out so that we didn't double build based on your original feedback. The non-native ones are built here, and then the native ones are part of Am I misunderstanding something? |
||||||
compileExtensionMediaBuildTask, | ||||||
minified ? minifyVSCodeTask : bundleVSCodeTask, | ||||||
vscodeTaskCI | ||||||
|
@@ -537,7 +539,7 @@ gulp.task(task.define( | |||||
'vscode-translations-export', | ||||||
task.series( | ||||||
core, | ||||||
compileExtensionsBuildTask, | ||||||
compileAllExtensionsBuildTask, | ||||||
function () { | ||||||
const pathToMetadata = './out-build/nls.metadata.json'; | ||||||
const pathToExtensions = '.build/extensions/*'; | ||||||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,4 @@ vsc-extension-quickstart.md | |
**/tslint.json | ||
**/*.map | ||
**/*.ts | ||
packageMocks/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,10 +8,42 @@ | |
'use strict'; | ||
|
||
const withDefaults = require('../shared.webpack.config'); | ||
const CopyWebpackPlugin = require('copy-webpack-plugin'); | ||
const path = require('path'); | ||
const { NormalModuleReplacementPlugin } = require('webpack'); | ||
|
||
const isWindows = process.platform === 'win32'; | ||
|
||
module.exports = withDefaults({ | ||
context: __dirname, | ||
entry: { | ||
extension: './src/extension.ts' | ||
} | ||
}, | ||
externals: { | ||
// The @azure/msal-node-runtime package requires this native node module (.node). | ||
// It is currently only included on Windows, but the package handles unsupported platforms | ||
// gracefully. | ||
'./msal-node-runtime': 'commonjs ./msal-node-runtime' | ||
}, | ||
plugins: [ | ||
...withDefaults.nodePlugins(__dirname), | ||
new CopyWebpackPlugin({ | ||
patterns: [ | ||
{ | ||
// The native files we need to ship with the extension | ||
from: '**/dist/msal*.(node|dll)', | ||
to: '[name][ext]', | ||
// These will only be present on Windows for now | ||
noErrorOnMissing: !isWindows | ||
} | ||
] | ||
}), | ||
// We don't use the feature that uses Dpapi, so we can just replace it with a mock. | ||
// This is a bit of a hack, but it's the easiest way to do it. Really, msal should | ||
// handle when this native node module is not available. | ||
new NormalModuleReplacementPlugin( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can go away when this is released: AzureAD/microsoft-authentication-library-for-js#7412 |
||
/\.\.\/Dpapi\.mjs/, | ||
path.resolve(__dirname, 'packageMocks', 'dpapi', 'dpapi.js') | ||
) | ||
] | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@deepak1556 this fixed the Create Universal App step of the build for me. Let me know if you'd like to expand the scope but until then I've scoped it as small as possible.