Localization - Export strings to XLF file (#123)

This commit is contained in:
Crash Collison 2021-10-05 16:03:42 -07:00 коммит произвёл GitHub
Родитель e5cf76a6ae
Коммит 160d644e2a
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
9 изменённых файлов: 719 добавлений и 17 удалений

Просмотреть файл

@ -4,8 +4,10 @@
/* eslint-disable no-undef */
"use strict";
const util = require('util');
const nls = require('vscode-nls-dev');
const exec = util.promisify(require('child_process').exec);
const gulp = require('gulp');
const filter = require('gulp-filter');
const eslint = require('gulp-eslint');
const mocha = require('gulp-mocha');
const moment = require('moment');
@ -221,6 +223,8 @@ const recompile = gulp.series(
async () => nugetInstall('CAP_ISVExp_Tools_Stable', 'Microsoft.PowerApps.CLI',cliVersion, path.resolve(distdir, 'pac')),
async () => nugetInstall('CAP_ISVExp_Tools_Stable', 'Microsoft.PowerApps.CLI.Core.osx-x64', cliVersion, path.resolve(distdir, 'pac')),
async () => nugetInstall('CAP_ISVExp_Tools_Stable', 'Microsoft.PowerApps.CLI.Core.linux-x64', cliVersion, path.resolve(distdir, 'pac')),
translationsExport,
translationsGenerateSrcLocBundles,
compile,
);
@ -231,6 +235,33 @@ const dist = gulp.series(
test
);
const translationExtensionName = "vscode-powerplatform";
// Extract all the localizable strings from TS and package.nls.json, and package into
// an XLF for the localization team
async function translationsExport() {
return gulp
.src('src/**/*.ts')
.pipe(nls.createMetaDataFiles())
.pipe(filter(['**/*.nls.json', '**/*.nls.metadata.json']))
.pipe(nls.bundleMetaDataFiles('ms-vscode.powerplatform', '.'))
.pipe(filter(['**/nls.metadata.header.json', '**/nls.metadata.json']))
.pipe(gulp.src(["package.nls.json"]))
.pipe(nls.createXlfFiles("translations-export", translationExtensionName))
.pipe(gulp.dest(path.join("loc")));
}
function translationsGenerateSrcLocBundles() {
return gulp.src('src/**/*.ts')
.pipe(nls.createMetaDataFiles())
// .pipe(nls.createAdditionalLanguageFiles(languages, "i18n")) // TODO, Task 2462031 once translations are available
.pipe(nls.bundleMetaDataFiles('ms-vscode.powerplatform', path.join('dist', 'src')))
.pipe(nls.bundleLanguageFiles())
.pipe(filter(['**/nls.bundle.*.json', '**/nls.metadata.header.json', '**/nls.metadata.json']))
.pipe(filter(['**/nls.*.json']))
.pipe(gulp.dest(path.join('dist', 'src')));
}
exports.clean = clean;
exports.compile = compile;
exports.recompile = recompile;
@ -240,5 +271,6 @@ exports.test = test;
exports.package = packageVsix;
exports.ci = dist;
exports.dist = dist;
exports.translationsExport = translationsExport;
exports.setGitAuthN = setGitAuthN;
exports.default = compile;

Просмотреть файл

@ -0,0 +1,175 @@
<?xml version="1.0" encoding="utf-8"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file original="package" source-language="en" datatype="plaintext"><body>
<trans-unit id="pacCLI.openDocumentation.title">
<source xml:lang="en">Documentation</source>
</trans-unit>
<trans-unit id="pacCLI.openPacLab.title">
<source xml:lang="en">Open PAC Lab</source>
</trans-unit>
<trans-unit id="pacCLI.pacHelp.title">
<source xml:lang="en">Show PAC Help</source>
</trans-unit>
<trans-unit id="pacCLI.pacAuthHelp.title">
<source xml:lang="en">Show PAC Authentication Help</source>
</trans-unit>
<trans-unit id="pacCLI.pacPackageHelp.title">
<source xml:lang="en">Show PAC Package Help</source>
</trans-unit>
<trans-unit id="pacCLI.pacPcfHelp.title">
<source xml:lang="en">Show PAC PCF Help</source>
</trans-unit>
<trans-unit id="pacCLI.pacSolutionHelp.title">
<source xml:lang="en">Show PAC Solution Help</source>
</trans-unit>
<trans-unit id="pacCLI.disableTelemetry.title">
<source xml:lang="en">Disable PAC Telemetry</source>
</trans-unit>
<trans-unit id="pacCLI.enableTelemetry.title">
<source xml:lang="en">Enable PAC telemetry</source>
</trans-unit>
<trans-unit id="power-platform-activitybar.title">
<source xml:lang="en">Power Platform</source>
</trans-unit>
<trans-unit id="pacCLI.authPanel.title">
<source xml:lang="en">Auth Profiles</source>
</trans-unit>
<trans-unit id="pacCLI.authPanel.welcome.whenInteractiveSupported">
<source xml:lang="en">No auth profiles found on this computer.
[Add Admin Auth Profile](command:pacCLI.authPanel.newAdminAuthProfile)
[Add Dataverse Auth Profile](command:pacCLI.authPanel.newDataverseAuthProfile)</source>
<note>This is a Markdown formatted string, and the formatting must persist across translations.
The second line should be '[TRANSLATION HERE](command:pacCLI.authPanel.newAdminAuthProfile)', keeping brackets and the text in the parentheses unmodified
The third line should be '[TRANSLATION HERE](command:pacCLI.authPanel.newDataverseAuthProfile)', keeping brackets and the text in the parentheses unmodified</note>
</trans-unit>
<trans-unit id="pacCLI.authPanel.welcome.whenInteractiveNotSupported">
<source xml:lang="en">No auth profiles found on this computer.
[View Auth Profile Help](command:pacCLI.pacAuthHelp)</source>
<note>This is a Markdown formatted string, and the formatting must persist across translations.
The second line should be '[TRANSLATION HERE](command:pacCLI.pacAuthHelp)', keeping brackets and the text in the parentheses unmodified</note>
</trans-unit>
<trans-unit id="pacCLI.authPanel.clearAuthProfile.title">
<source xml:lang="en">Clear Auth Profiles</source>
</trans-unit>
<trans-unit id="pacCLI.authPanel.refresh.title">
<source xml:lang="en">Refresh</source>
</trans-unit>
<trans-unit id="pacCLI.authPanel.newDataverseAuthProfile.title">
<source xml:lang="en">New Dataverse Auth Profile</source>
</trans-unit>
<trans-unit id="pacCLI.authPanel.newAdminAuthProfile.title">
<source xml:lang="en">New Admin Auth Profile</source>
</trans-unit>
<trans-unit id="pacCLI.authPanel.selectAuthProfile.title">
<source xml:lang="en">Select Auth Profile</source>
</trans-unit>
<trans-unit id="pacCLI.authPanel.deleteAuthProfile.title">
<source xml:lang="en">Delete Auth Profile</source>
</trans-unit>
<trans-unit id="pacCLI.authPanel.nameAuthProfile.title">
<source xml:lang="en">Name/Rename Auth Profile</source>
</trans-unit>
<trans-unit id="pacCLI.authPanel.navigateToResource.title">
<source xml:lang="en">Navigate to Resource</source>
</trans-unit>
<trans-unit id="pacCLI.authPanel.copyUser.title">
<source xml:lang="en">Copy User</source>
</trans-unit>
<trans-unit id="pacCLI.solutionPanel.title">
<source xml:lang="en">Solutions</source>
</trans-unit>
<trans-unit id="pacCLI.solutionPanel.refresh.title">
<source xml:lang="en">Refresh</source>
</trans-unit>
<trans-unit id="pacCLI.solutionPanel.copyFriendlyName.title">
<source xml:lang="en">Copy Friendly Name</source>
</trans-unit>
<trans-unit id="pacCLI.solutionPanel.copyVersionNumber.title">
<source xml:lang="en">Copy Version Number</source>
</trans-unit>
<trans-unit id="pacCLI.adminEnvironmentPanel.title">
<source xml:lang="en">Admin Environments</source>
</trans-unit>
<trans-unit id="pacCLI.adminEnvironmentPanel.refresh.title">
<source xml:lang="en">Refresh</source>
</trans-unit>
<trans-unit id="pacCLI.adminEnvironmentPanel.copyDisplayName.title">
<source xml:lang="en">Copy Display Name</source>
</trans-unit>
<trans-unit id="pacCLI.adminEnvironmentPanel.copyEnvironmentId.title">
<source xml:lang="en">Copy Environment Id</source>
</trans-unit>
<trans-unit id="pacCLI.adminEnvironmentPanel.copyEnvironmentUrl.title">
<source xml:lang="en">Copy Environment Url</source>
</trans-unit>
<trans-unit id="pacCLI.adminEnvironmentPanel.copyOrganizationId.title">
<source xml:lang="en">Copy Organization Id</source>
</trans-unit>
<trans-unit id="microsoft-powerapps-portals.preview-show.title">
<source xml:lang="en">PowerApps Portal -&gt; Show preview</source>
</trans-unit>
</body></file>
<file original="./client/lib/CliAcquisition" source-language="en" datatype="plaintext"><body>
<trans-unit id="cliAquisition.preparingMessage">
<source xml:lang="en">Preparing pac CLI (v{0})...</source>
<note>{0} represents the version number</note>
</trans-unit>
<trans-unit id="cliAquisition.successMessage">
<source xml:lang="en">The pac CLI is ready for use in your VS Code terminal!</source>
</trans-unit>
<trans-unit id="cliAquisition.installationErrorMessage">
<source xml:lang="en">Cannot install pac CLI: {0}</source>
<note>{0} represents the error message returned from the exception</note>
</trans-unit>
</body></file>
<file original="./client/lib/PacActivityBarUI" source-language="en" datatype="plaintext"><body>
<trans-unit id="pacCLI.authPanel.clearAuthProfile.confirm">
<source xml:lang="en">Confirm</source>
</trans-unit>
<trans-unit id="pacCLI.authPanel.clearAuthProfile.prompt">
<source xml:lang="en">Are you sure you want to clear all the Auth Profiles?</source>
</trans-unit>
<trans-unit id="pacCLI.authPanel.clearAuthProfile.cancel">
<source xml:lang="en">Cancel</source>
</trans-unit>
<trans-unit id="pacCLI.authPanel.newDataverseAuthProfile.title">
<source xml:lang="en">Create new Dataverse Auth Profile</source>
</trans-unit>
<trans-unit id="pacCLI.authPanel.newDataverseAuthProfile.prompt">
<source xml:lang="en">Enter Environment URL</source>
</trans-unit>
<trans-unit id="pacCLI.authPanel.deleteAuthProfile.confirm">
<source xml:lang="en">Confirm</source>
</trans-unit>
<trans-unit id="pacCLI.authPanel.deleteAuthProfile.prompt">
<source xml:lang="en">Are you sure you want to delete the Auth Profile {0}-{1}?</source>
<note>{0} is the user name, {1} is the URL of environment of the auth profile</note>
</trans-unit>
<trans-unit id="pacCLI.authPanel.deleteAuthProfile.cancel">
<source xml:lang="en">Cancel</source>
</trans-unit>
<trans-unit id="pacCLI.authPanel.nameAuthProfile.title">
<source xml:lang="en">Name/Rename Auth Profile</source>
</trans-unit>
<trans-unit id="pacCLI.authPanel.nameAuthProfile.prompt">
<source xml:lang="en">The name you want to give to this authentication profile</source>
</trans-unit>
<trans-unit id="pacCLI.authPanel.nameAuthProfile.validation">
<source xml:lang="en">Maximum 12 characters allowed</source>
</trans-unit>
</body></file>
<file original="./client/lib/PacTerminal" source-language="en" datatype="plaintext"><body>
<trans-unit id="pacCLI.enableTelemetry.successMessage">
<source xml:lang="en">PAC Telemetry enabled</source>
</trans-unit>
<trans-unit id="pacCLI.enableTelemetry.failureMessage">
<source xml:lang="en">Failed to enable PAC telemetry.</source>
</trans-unit>
<trans-unit id="pacCLI.disableTelemetry.successMessage">
<source xml:lang="en">PAC Telemetry disabled</source>
</trans-unit>
<trans-unit id="pacCLI.disableTelemetry.failureMessage">
<source xml:lang="en">Failed to disable PAC telemetry.</source>
</trans-unit>
</body></file>
</xliff>

Просмотреть файл

@ -0,0 +1,2 @@
Placeholder - place the translated XLF files in this directory.
They will be imported as part of the build process with Task 2462031: Localization - Import translated XLF files

451
package-lock.json сгенерированный
Просмотреть файл

@ -19,6 +19,7 @@
"vscode-languageclient": "^7.0.0",
"vscode-languageserver": "^7.0.0",
"vscode-languageserver-textdocument": "^1.0.1",
"vscode-nls": "^5.0.0",
"yaml": "^1.10.2"
},
"devDependencies": {
@ -40,6 +41,7 @@
"fs-extra": "^9.0.1",
"gulp": "^4.0.2",
"gulp-eslint": "^6.0.0",
"gulp-filter": "^7.0.0",
"gulp-mocha": "^8.0.0",
"gulp-sourcemaps": "^2.6.5",
"gulp-typescript": "^6.0.0-alpha.1",
@ -52,6 +54,7 @@
"ts-node": "^9.0.0",
"typescript": "^4.0.5",
"vsce": "^1.81.1",
"vscode-nls-dev": "^4.0.0-next.1",
"vscode-test": "^1.5.2",
"webpack": "^5.10.0",
"webpack-cli": "^4.7.0",
@ -1473,6 +1476,15 @@
"node": ">=0.10.0"
}
},
"node_modules/array-differ": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz",
"integrity": "sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==",
"dev": true,
"engines": {
"node": ">=8"
}
},
"node_modules/array-each": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz",
@ -1566,6 +1578,15 @@
"node": ">=0.10.0"
}
},
"node_modules/arrify": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz",
"integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==",
"dev": true,
"engines": {
"node": ">=8"
}
},
"node_modules/asn1.js": {
"version": "5.4.1",
"resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz",
@ -3699,6 +3720,12 @@
"node": ">=8"
}
},
"node_modules/duplexer": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz",
"integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==",
"dev": true
},
"node_modules/duplexer2": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz",
@ -4187,6 +4214,21 @@
"es5-ext": "~0.10.14"
}
},
"node_modules/event-stream": {
"version": "3.3.5",
"resolved": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.5.tgz",
"integrity": "sha512-vyibDcu5JL20Me1fP734QBH/kenBGLZap2n0+XXM7mvuUPzJ20Ydqj1aKcIeMdri1p+PU+4yAKugjN8KCVst+g==",
"dev": true,
"dependencies": {
"duplexer": "^0.1.1",
"from": "^0.1.7",
"map-stream": "0.0.7",
"pause-stream": "^0.0.11",
"split": "^1.0.1",
"stream-combiner": "^0.2.2",
"through": "^2.3.8"
}
},
"node_modules/events": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz",
@ -4951,6 +4993,12 @@
"node": ">=0.10.0"
}
},
"node_modules/from": {
"version": "0.1.7",
"resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz",
"integrity": "sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4=",
"dev": true
},
"node_modules/from2": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz",
@ -6312,6 +6360,32 @@
"which": "bin/which"
}
},
"node_modules/gulp-filter": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/gulp-filter/-/gulp-filter-7.0.0.tgz",
"integrity": "sha512-ZGWtJo0j1mHfP77tVuhyqem4MRA5NfNRjoVe6VAkLGeQQ/QGo2VsFwp7zfPTGDsd1rwzBmoDHhxpE6f5B3Zuaw==",
"dev": true,
"dependencies": {
"multimatch": "^5.0.0",
"plugin-error": "^1.0.1",
"streamfilter": "^3.0.0",
"to-absolute-glob": "^2.0.2"
},
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
},
"peerDependencies": {
"gulp": ">=4"
},
"peerDependenciesMeta": {
"gulp": {
"optional": true
}
}
},
"node_modules/gulp-mocha": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/gulp-mocha/-/gulp-mocha-8.0.0.tgz",
@ -6905,6 +6979,15 @@
"node": ">=0.10.0"
}
},
"node_modules/is": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/is/-/is-3.3.0.tgz",
"integrity": "sha512-nW24QBoPcFGGHJGUwnfpI7Yc5CdqWNdsyHQszVE/z2pKHXzh7FZ5GWhJqSyaQ9wMkQnsTx+kAI8bHlCX4tKdbg==",
"dev": true,
"engines": {
"node": "*"
}
},
"node_modules/is-absolute": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz",
@ -7778,6 +7861,12 @@
"node": ">=0.10.0"
}
},
"node_modules/map-stream": {
"version": "0.0.7",
"resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.0.7.tgz",
"integrity": "sha1-ih8HiW2CsQkmvTdEokIACfiJdKg=",
"dev": true
},
"node_modules/map-visit": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz",
@ -8542,6 +8631,25 @@
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
},
"node_modules/multimatch": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/multimatch/-/multimatch-5.0.0.tgz",
"integrity": "sha512-ypMKuglUrZUD99Tk2bUQ+xNQj43lPEfAeX2o9cTteAmShXy2VHDJpuwu1o0xqoKCt9jLVAvwyFKdLTPXKAfJyA==",
"dev": true,
"dependencies": {
"@types/minimatch": "^3.0.3",
"array-differ": "^3.0.0",
"array-union": "^2.1.0",
"arrify": "^2.0.1",
"minimatch": "^3.0.4"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/mute-stdout": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/mute-stdout/-/mute-stdout-1.0.1.tgz",
@ -9678,6 +9786,15 @@
"node": "*"
}
},
"node_modules/pause-stream": {
"version": "0.0.11",
"resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz",
"integrity": "sha1-/lo0sMvOErWqaitAPuLnO2AvFEU=",
"dev": true,
"dependencies": {
"through": "~2.3"
}
},
"node_modules/pbkdf2": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz",
@ -10902,6 +11019,12 @@
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
"dev": true
},
"node_modules/sax": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==",
"dev": true
},
"node_modules/schema-utils": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.0.0.tgz",
@ -11363,6 +11486,18 @@
"integrity": "sha512-Ki212dKK4ogX+xDo4CtOZBVIwhsKBEfsEEcwmJfLQzirgc2jIWdzg40Unxz/HzEUqM1WFzVlQSMF9kZZ2HboLQ==",
"dev": true
},
"node_modules/split": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz",
"integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==",
"dev": true,
"dependencies": {
"through": "2"
},
"engines": {
"node": "*"
}
},
"node_modules/split-on-first": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-1.1.0.tgz",
@ -11473,6 +11608,16 @@
"readable-stream": "^2.0.2"
}
},
"node_modules/stream-combiner": {
"version": "0.2.2",
"resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.2.2.tgz",
"integrity": "sha1-rsjLrBd7Vrb0+kec7YwZEs7lKFg=",
"dev": true,
"dependencies": {
"duplexer": "~0.1.1",
"through": "~2.3.4"
}
},
"node_modules/stream-each": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.3.tgz",
@ -11508,6 +11653,32 @@
"integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==",
"dev": true
},
"node_modules/streamfilter": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/streamfilter/-/streamfilter-3.0.0.tgz",
"integrity": "sha512-kvKNfXCmUyC8lAXSSHCIXBUlo/lhsLcCU/OmzACZYpRUdtKIH68xYhm/+HI15jFJYtNJGYtCgn2wmIiExY1VwA==",
"dev": true,
"dependencies": {
"readable-stream": "^3.0.6"
},
"engines": {
"node": ">=8.12.0"
}
},
"node_modules/streamfilter/node_modules/readable-stream": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
"integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
"dev": true,
"dependencies": {
"inherits": "^2.0.3",
"string_decoder": "^1.1.1",
"util-deprecate": "^1.0.1"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/strict-uri-encode": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz",
@ -12879,6 +13050,65 @@
"resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.16.0.tgz",
"integrity": "sha512-k8luDIWJWyenLc5ToFQQMaSrqCHiLwyKPHKPQZ5zz21vM+vIVUSvsRpcbiECH4WR88K2XZqc4ScRcZ7nk/jbeA=="
},
"node_modules/vscode-nls": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/vscode-nls/-/vscode-nls-5.0.0.tgz",
"integrity": "sha512-u0Lw+IYlgbEJFF6/qAqG2d1jQmJl0eyAGJHoAJqr2HT4M2BNuQYSEiSE75f52pXHSJm8AlTjnLLbBFPrdz2hpA=="
},
"node_modules/vscode-nls-dev": {
"version": "4.0.0-next.1",
"resolved": "https://registry.npmjs.org/vscode-nls-dev/-/vscode-nls-dev-4.0.0-next.1.tgz",
"integrity": "sha512-6sBb0dGq1t8RGjTZiBu3tWQX2baC1PWtMyjzUqJ9esDXV1TOl11J80OQqhRTvwL6P55U0pgu+28KnHPJs5kbfg==",
"dev": true,
"license": "MIT",
"dependencies": {
"ansi-colors": "^4.1.1",
"clone": "^2.1.2",
"event-stream": "^3.3.4",
"fancy-log": "^1.3.3",
"glob": "^7.1.7",
"iconv-lite": "^0.6.3",
"is": "^3.3.0",
"source-map": "^0.6.1",
"typescript": "^4.3.2",
"vinyl": "^2.2.1",
"xml2js": "^0.4.23",
"yargs": "^17.0.1"
},
"bin": {
"vscl": "lib/vscl.js"
}
},
"node_modules/vscode-nls-dev/node_modules/iconv-lite": {
"version": "0.6.3",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
"integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
"dev": true,
"dependencies": {
"safer-buffer": ">= 2.1.2 < 3.0.0"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/vscode-nls-dev/node_modules/yargs": {
"version": "17.1.1",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-17.1.1.tgz",
"integrity": "sha512-c2k48R0PwKIqKhPMWjeiF6y2xY/gPMUlro0sgxqXpbOIohWiLNXWslsootttv7E1e73QPAMQSg5FeySbVcpsPQ==",
"dev": true,
"dependencies": {
"cliui": "^7.0.2",
"escalade": "^3.1.1",
"get-caller-file": "^2.0.5",
"require-directory": "^2.1.1",
"string-width": "^4.2.0",
"y18n": "^5.0.5",
"yargs-parser": "^20.2.2"
},
"engines": {
"node": ">=12"
}
},
"node_modules/vscode-test": {
"version": "1.5.2",
"resolved": "https://registry.npmjs.org/vscode-test/-/vscode-test-1.5.2.tgz",
@ -13953,6 +14183,28 @@
"node": ">=8"
}
},
"node_modules/xml2js": {
"version": "0.4.23",
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz",
"integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==",
"dev": true,
"dependencies": {
"sax": ">=0.6.0",
"xmlbuilder": "~11.0.0"
},
"engines": {
"node": ">=4.0.0"
}
},
"node_modules/xmlbuilder": {
"version": "11.0.1",
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz",
"integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==",
"dev": true,
"engines": {
"node": ">=4.0"
}
},
"node_modules/xtend": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
@ -15251,6 +15503,12 @@
"integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=",
"dev": true
},
"array-differ": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/array-differ/-/array-differ-3.0.0.tgz",
"integrity": "sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg==",
"dev": true
},
"array-each": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/array-each/-/array-each-1.0.1.tgz",
@ -15321,6 +15579,12 @@
"integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=",
"dev": true
},
"arrify": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz",
"integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==",
"dev": true
},
"asn1.js": {
"version": "5.4.1",
"resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz",
@ -17051,6 +17315,12 @@
"is-obj": "^2.0.0"
}
},
"duplexer": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz",
"integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==",
"dev": true
},
"duplexer2": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz",
@ -17455,6 +17725,21 @@
"es5-ext": "~0.10.14"
}
},
"event-stream": {
"version": "3.3.5",
"resolved": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.5.tgz",
"integrity": "sha512-vyibDcu5JL20Me1fP734QBH/kenBGLZap2n0+XXM7mvuUPzJ20Ydqj1aKcIeMdri1p+PU+4yAKugjN8KCVst+g==",
"dev": true,
"requires": {
"duplexer": "^0.1.1",
"from": "^0.1.7",
"map-stream": "0.0.7",
"pause-stream": "^0.0.11",
"split": "^1.0.1",
"stream-combiner": "^0.2.2",
"through": "^2.3.8"
}
},
"events": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz",
@ -18071,6 +18356,12 @@
"map-cache": "^0.2.2"
}
},
"from": {
"version": "0.1.7",
"resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz",
"integrity": "sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4=",
"dev": true
},
"from2": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz",
@ -19158,6 +19449,18 @@
}
}
},
"gulp-filter": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/gulp-filter/-/gulp-filter-7.0.0.tgz",
"integrity": "sha512-ZGWtJo0j1mHfP77tVuhyqem4MRA5NfNRjoVe6VAkLGeQQ/QGo2VsFwp7zfPTGDsd1rwzBmoDHhxpE6f5B3Zuaw==",
"dev": true,
"requires": {
"multimatch": "^5.0.0",
"plugin-error": "^1.0.1",
"streamfilter": "^3.0.0",
"to-absolute-glob": "^2.0.2"
}
},
"gulp-mocha": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/gulp-mocha/-/gulp-mocha-8.0.0.tgz",
@ -19597,6 +19900,12 @@
"integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=",
"dev": true
},
"is": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/is/-/is-3.3.0.tgz",
"integrity": "sha512-nW24QBoPcFGGHJGUwnfpI7Yc5CdqWNdsyHQszVE/z2pKHXzh7FZ5GWhJqSyaQ9wMkQnsTx+kAI8bHlCX4tKdbg==",
"dev": true
},
"is-absolute": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz",
@ -20283,6 +20592,12 @@
"integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=",
"dev": true
},
"map-stream": {
"version": "0.0.7",
"resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.0.7.tgz",
"integrity": "sha1-ih8HiW2CsQkmvTdEokIACfiJdKg=",
"dev": true
},
"map-visit": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz",
@ -20896,6 +21211,19 @@
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
},
"multimatch": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/multimatch/-/multimatch-5.0.0.tgz",
"integrity": "sha512-ypMKuglUrZUD99Tk2bUQ+xNQj43lPEfAeX2o9cTteAmShXy2VHDJpuwu1o0xqoKCt9jLVAvwyFKdLTPXKAfJyA==",
"dev": true,
"requires": {
"@types/minimatch": "^3.0.3",
"array-differ": "^3.0.0",
"array-union": "^2.1.0",
"arrify": "^2.0.1",
"minimatch": "^3.0.4"
}
},
"mute-stdout": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/mute-stdout/-/mute-stdout-1.0.1.tgz",
@ -21801,6 +22129,15 @@
"integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==",
"dev": true
},
"pause-stream": {
"version": "0.0.11",
"resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz",
"integrity": "sha1-/lo0sMvOErWqaitAPuLnO2AvFEU=",
"dev": true,
"requires": {
"through": "~2.3"
}
},
"pbkdf2": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz",
@ -22747,6 +23084,12 @@
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
"dev": true
},
"sax": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==",
"dev": true
},
"schema-utils": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.0.0.tgz",
@ -23123,6 +23466,15 @@
"integrity": "sha512-Ki212dKK4ogX+xDo4CtOZBVIwhsKBEfsEEcwmJfLQzirgc2jIWdzg40Unxz/HzEUqM1WFzVlQSMF9kZZ2HboLQ==",
"dev": true
},
"split": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz",
"integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==",
"dev": true,
"requires": {
"through": "2"
}
},
"split-on-first": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-1.1.0.tgz",
@ -23214,6 +23566,16 @@
"readable-stream": "^2.0.2"
}
},
"stream-combiner": {
"version": "0.2.2",
"resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.2.2.tgz",
"integrity": "sha1-rsjLrBd7Vrb0+kec7YwZEs7lKFg=",
"dev": true,
"requires": {
"duplexer": "~0.1.1",
"through": "~2.3.4"
}
},
"stream-each": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.3.tgz",
@ -23249,6 +23611,28 @@
"integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==",
"dev": true
},
"streamfilter": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/streamfilter/-/streamfilter-3.0.0.tgz",
"integrity": "sha512-kvKNfXCmUyC8lAXSSHCIXBUlo/lhsLcCU/OmzACZYpRUdtKIH68xYhm/+HI15jFJYtNJGYtCgn2wmIiExY1VwA==",
"dev": true,
"requires": {
"readable-stream": "^3.0.6"
},
"dependencies": {
"readable-stream": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz",
"integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==",
"dev": true,
"requires": {
"inherits": "^2.0.3",
"string_decoder": "^1.1.1",
"util-deprecate": "^1.0.1"
}
}
}
},
"strict-uri-encode": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz",
@ -24372,6 +24756,57 @@
"resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.16.0.tgz",
"integrity": "sha512-k8luDIWJWyenLc5ToFQQMaSrqCHiLwyKPHKPQZ5zz21vM+vIVUSvsRpcbiECH4WR88K2XZqc4ScRcZ7nk/jbeA=="
},
"vscode-nls": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/vscode-nls/-/vscode-nls-5.0.0.tgz",
"integrity": "sha512-u0Lw+IYlgbEJFF6/qAqG2d1jQmJl0eyAGJHoAJqr2HT4M2BNuQYSEiSE75f52pXHSJm8AlTjnLLbBFPrdz2hpA=="
},
"vscode-nls-dev": {
"version": "4.0.0-next.1",
"resolved": "https://registry.npmjs.org/vscode-nls-dev/-/vscode-nls-dev-4.0.0-next.1.tgz",
"integrity": "sha512-6sBb0dGq1t8RGjTZiBu3tWQX2baC1PWtMyjzUqJ9esDXV1TOl11J80OQqhRTvwL6P55U0pgu+28KnHPJs5kbfg==",
"dev": true,
"requires": {
"ansi-colors": "^4.1.1",
"clone": "^2.1.2",
"event-stream": "^3.3.4",
"fancy-log": "^1.3.3",
"glob": "^7.1.7",
"iconv-lite": "^0.6.3",
"is": "^3.3.0",
"source-map": "^0.6.1",
"typescript": "^4.3.2",
"vinyl": "^2.2.1",
"xml2js": "^0.4.23",
"yargs": "^17.0.1"
},
"dependencies": {
"iconv-lite": {
"version": "0.6.3",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
"integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
"dev": true,
"requires": {
"safer-buffer": ">= 2.1.2 < 3.0.0"
}
},
"yargs": {
"version": "17.1.1",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-17.1.1.tgz",
"integrity": "sha512-c2k48R0PwKIqKhPMWjeiF6y2xY/gPMUlro0sgxqXpbOIohWiLNXWslsootttv7E1e73QPAMQSg5FeySbVcpsPQ==",
"dev": true,
"requires": {
"cliui": "^7.0.2",
"escalade": "^3.1.1",
"get-caller-file": "^2.0.5",
"require-directory": "^2.1.1",
"string-width": "^4.2.0",
"y18n": "^5.0.5",
"yargs-parser": "^20.2.2"
}
}
}
},
"vscode-test": {
"version": "1.5.2",
"resolved": "https://registry.npmjs.org/vscode-test/-/vscode-test-1.5.2.tgz",
@ -25216,6 +25651,22 @@
"integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==",
"dev": true
},
"xml2js": {
"version": "0.4.23",
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz",
"integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==",
"dev": true,
"requires": {
"sax": ">=0.6.0",
"xmlbuilder": "~11.0.0"
}
},
"xmlbuilder": {
"version": "11.0.1",
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz",
"integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==",
"dev": true
},
"xtend": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",

Просмотреть файл

@ -9,6 +9,7 @@
"test": "node node_modules/gulp/bin/gulp.js test",
"ci": "node node_modules/gulp/bin/gulp.js ci",
"dist": "node node_modules/gulp/bin/gulp.js dist",
"translations-export": "node node_modules/gulp/bin/gulp.js translationsExport",
"set-git-authn": "node node_modules/gulp/bin/gulp.js setGitAuthN",
"increment-version": "node node_modules/release-it/bin/release-it --increment patch --ci -VV",
"increment-version-npm": "npm version %VSIX_VERSION%",
@ -450,6 +451,7 @@
"fs-extra": "^9.0.1",
"gulp": "^4.0.2",
"gulp-eslint": "^6.0.0",
"gulp-filter": "^7.0.0",
"gulp-mocha": "^8.0.0",
"gulp-sourcemaps": "^2.6.5",
"gulp-typescript": "^6.0.0-alpha.1",
@ -462,6 +464,7 @@
"ts-node": "^9.0.0",
"typescript": "^4.0.5",
"vsce": "^1.81.1",
"vscode-nls-dev": "^4.0.0-next.1",
"vscode-test": "^1.5.2",
"webpack": "^5.10.0",
"webpack-cli": "^4.7.0",
@ -479,6 +482,7 @@
"vscode-languageclient": "^7.0.0",
"vscode-languageserver": "^7.0.0",
"vscode-languageserver-textdocument": "^1.0.1",
"vscode-nls": "^5.0.0",
"yaml": "^1.10.2"
}
}

Просмотреть файл

@ -3,6 +3,10 @@
// https://code.visualstudio.com/api/extension-capabilities/common-capabilities#output-channel
import * as nls from 'vscode-nls';
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
import * as path from 'path';
import * as fs from 'fs-extra';
import * as glob from 'glob';
@ -66,7 +70,11 @@ export class CliAcquisition implements IDisposable {
return Promise.resolve(pacToolsPath);
}
// nupkg has not been extracted yet:
this._context.showInformationMessage(`Preparing pac CLI (v${this.cliVersion})...`);
this._context.showInformationMessage(
localize({
key: "cliAquisition.preparingMessage",
comment: ["{0} represents the version number"]},
"Preparing pac CLI (v{0})...", this.cliVersion));
await this.killProcessesInUse(pacToolsPath);
fs.emptyDirSync(this._cliPath);
return new Promise((resolve, reject) => {
@ -74,14 +82,17 @@ export class CliAcquisition implements IDisposable {
.pipe(Extract({ path: this._cliPath }))
.on('close', () => {
this._context.telemetry.sendTelemetryEvent('PacCliInstalled', { cliVersion: this.cliVersion });
this._context.showInformationMessage('The pac CLI is ready for use in your VS Code terminal!');
this._context.showInformationMessage(localize("cliAquisition.successMessage", 'The pac CLI is ready for use in your VS Code terminal!'));
if (os.platform() !== 'win32') {
fs.chmodSync(this.cliExePath, 0o755);
}
this.setInstalledVersion(this._cliVersion);
resolve(pacToolsPath);
}).on('error', (err: unknown) => {
this._context.showErrorMessage(`Cannot install pac CLI: ${err}`);
this._context.showErrorMessage(localize({
key: "cliAquisition.installationErrorMessage",
comment: ["{0} represents the error message returned from the exception"]},
"Cannot install pac CLI: {0}", String(err)));
reject(err);
})
});

Просмотреть файл

@ -1,6 +1,10 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import * as nls from 'vscode-nls';
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
import * as vscode from 'vscode';
import { PacWrapper } from '../pac/PacWrapper';
import { PacFlatDataView, SolutionTreeItem, AdminEnvironmentTreeItem, AuthProfileTreeItem } from './PanelComponents';
@ -45,8 +49,12 @@ export function RegisterPanels(pacWrapper: PacWrapper): vscode.Disposable[] {
vscode.window.registerTreeDataProvider("pacCLI.authPanel", authPanel),
vscode.commands.registerCommand("pacCLI.authPanel.refresh", () => authPanel.refresh()),
vscode.commands.registerCommand("pacCLI.authPanel.clearAuthProfile", async () => {
const confirmResult = await vscode.window.showWarningMessage("Are you sure you want to clear all the Auth Profiles?","Confirm","Cancel");
if (confirmResult && confirmResult === "Confirm") {
const confirm = localize("pacCLI.authPanel.clearAuthProfile.confirm", "Confirm");
const confirmResult = await vscode.window.showWarningMessage(
localize("pacCLI.authPanel.clearAuthProfile.prompt", "Are you sure you want to clear all the Auth Profiles?"),
confirm,
localize("pacCLI.authPanel.clearAuthProfile.cancel","Cancel"));
if (confirmResult && confirmResult === confirm) {
await pacWrapper.authClear();
authPanel.refresh();
solutionPanel.refresh();
@ -55,8 +63,8 @@ export function RegisterPanels(pacWrapper: PacWrapper): vscode.Disposable[] {
}),
vscode.commands.registerCommand("pacCLI.authPanel.newDataverseAuthProfile", async () => {
const environmentUrl = await vscode.window.showInputBox({
title: "Create new Dataverse Auth Profile",
prompt: "Enter Environment URL",
title: localize("pacCLI.authPanel.newDataverseAuthProfile.title", "Create new Dataverse Auth Profile"),
prompt: localize("pacCLI.authPanel.newDataverseAuthProfile.prompt", "Enter Environment URL"),
placeHolder: "https://example.crm.dynamics.com/"
});
if (environmentUrl) {
@ -80,8 +88,16 @@ export function RegisterPanels(pacWrapper: PacWrapper): vscode.Disposable[] {
}
}),
vscode.commands.registerCommand("pacCLI.authPanel.deleteAuthProfile", async (item: AuthProfileTreeItem) => {
const confirmResult = await vscode.window.showWarningMessage(`Are you sure you want to delete the Auth Profile ${item.model.User}-${item.model.Resource}?`,"Confirm","Cancel");
if (confirmResult && confirmResult === "Confirm") {
const confirm = localize("pacCLI.authPanel.deleteAuthProfile.confirm", "Confirm");
const confirmResult = await vscode.window.showWarningMessage(
localize({ key: "pacCLI.authPanel.deleteAuthProfile.prompt",
comment: ["{0} is the user name, {1} is the URL of environment of the auth profile"]},
"Are you sure you want to delete the Auth Profile {0}-{1}?",
item.model.User,
item.model.Resource),
confirm,
localize("pacCLI.authPanel.deleteAuthProfile.cancel", "Cancel"));
if (confirmResult && confirmResult === confirm) {
await pacWrapper.authDeleteByIndex(item.model.Index);
authPanel.refresh();
if (item.model.Kind === "DATAVERSE") {
@ -93,9 +109,9 @@ export function RegisterPanels(pacWrapper: PacWrapper): vscode.Disposable[] {
}),
vscode.commands.registerCommand('pacCLI.authPanel.nameAuthProfile', async (item: AuthProfileTreeItem) => {
const authProfileName = await vscode.window.showInputBox({
title: "Name/Rename Auth Profile",
prompt: "The name you want to give to this authentication profile",
validateInput: value => value.length <= 12 ? null : 'Maximum 12 characters allowed'
title: localize("pacCLI.authPanel.nameAuthProfile.title", "Name/Rename Auth Profile"),
prompt: localize("pacCLI.authPanel.nameAuthProfile.prompt", "The name you want to give to this authentication profile"),
validateInput: value => value.length <= 12 ? null : localize("pacCLI.authPanel.nameAuthProfile.validation", 'Maximum 12 characters allowed')
});
if (authProfileName) {
await pacWrapper.authNameByIndex(item.model.Index, authProfileName);

Просмотреть файл

@ -1,6 +1,10 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import * as nls from 'vscode-nls';
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
const localize: nls.LocalizeFunc = nls.loadMessageBundle();
import * as path from 'path';
import * as vscode from 'vscode';
import { PacInterop, PacWrapper, PacWrapperContext } from '../pac/PacWrapper';
@ -39,18 +43,18 @@ export class PacTerminal implements vscode.Disposable {
this._cmdDisposables.push(vscode.commands.registerCommand(`pacCLI.enableTelemetry`, async () => {
const result = await this._pacWrapper.enableTelemetry();
if (result?.Status === "Success") {
vscode.window.showInformationMessage("PAC Telemetry enabled");
vscode.window.showInformationMessage(localize("pacCLI.enableTelemetry.successMessage", "PAC Telemetry enabled"));
} else {
vscode.window.showErrorMessage("Failed to enable PAC telemetry.")
vscode.window.showErrorMessage(localize("pacCLI.enableTelemetry.failureMessage", "Failed to enable PAC telemetry."));
}
}));
this._cmdDisposables.push(vscode.commands.registerCommand(`pacCLI.disableTelemetry`, async () => {
const result = await this._pacWrapper.disableTelemetry();
if (result?.Status === "Success") {
vscode.window.showInformationMessage("PAC Telemetry disabled");
vscode.window.showInformationMessage(localize("pacCLI.disableTelemetry.successMessage", "PAC Telemetry disabled"));
} else {
vscode.window.showErrorMessage("Failed to disable PAC telemetry.")
vscode.window.showErrorMessage(localize("pacCLI.disableTelemetry.failureMessage", "Failed to disable PAC telemetry."));
}
}));

Просмотреть файл

@ -37,7 +37,14 @@ const config = {
rules: [{
test: /\.ts$/,
exclude: /node_modules/,
use: [
use: [{
// vscode-nls-dev loader:
// * rewrite nls-calls
loader: 'vscode-nls-dev/lib/webpack-loader',
options: {
base: __dirname
}
},
{
loader: 'ts-loader'
}