Pick up latest TypeScript 4.2 nightly

This also migrates us to use our normal TS install for the serverless version
This commit is contained in:
Matt Bierner 2021-02-01 14:15:27 -08:00
parent 833bae4fd9
commit 925d9234b8
8 changed files with 17 additions and 24 deletions

View file

@ -4,7 +4,7 @@
"license": "MIT",
"description": "Dependencies shared by all extensions",
"dependencies": {
"typescript": "4.1.2"
"typescript": "^4.2.0-dev.20210201"
},
"scripts": {
"postinstall": "node ./postinstall"

View file

@ -38,19 +38,19 @@ module.exports = withBrowserDefaults({
new CopyPlugin({
patterns: [
{
from: 'node_modules/typescript-web/lib/*.d.ts',
to: 'typescript-web/',
from: '../node_modules/typescript/lib/*.d.ts',
to: 'typescript/',
flatten: true
},
{
from: 'node_modules/typescript-web/lib/typesMap.json',
to: 'typescript-web/'
from: '../node_modules/typescript/lib/typesMap.json',
to: 'typescript/'
},
...languages.map(lang => ({
from: `node_modules/typescript-web/lib/${lang}/**/*`,
to: 'typescript-web/',
from: `../node_modules/typescript/lib/${lang}/**/*`,
to: 'typescript/',
transformPath: (targetPath) => {
return targetPath.replace(/node_modules[\/\\]typescript-web[\/\\]lib/, '');
return targetPath.replace(/\.\.[\/\\]node_modules[\/\\]typescript[\/\\]lib/, '');
}
}))
],
@ -59,8 +59,8 @@ module.exports = withBrowserDefaults({
new CopyPlugin({
patterns: [
{
from: 'node_modules/typescript-web/lib/tsserver.js',
to: 'typescript-web/tsserver.web.js',
from: '../node_modules/typescript/lib/tsserver.js',
to: 'typescript/tsserver.web.js',
transform: (content) => {
return Terser.minify(content.toString()).code;

View file

@ -26,8 +26,7 @@
"devDependencies": {
"@types/node": "^12.19.9",
"@types/rimraf": "^2.0.4",
"@types/semver": "^5.5.0",
"typescript-web": "npm:typescript@^4.2.0-dev.20201209"
"@types/semver": "^5.5.0"
},
"scripts": {
"vscode:prepublish": "node ../../node_modules/gulp/bin/gulp.js --gulpfile ../../build/gulpfile.extensions.js compile-extension:typescript-language-features",

View file

@ -52,7 +52,7 @@ export function activate(
const versionProvider = new StaticVersionProvider(
new TypeScriptVersion(
TypeScriptVersionSource.Bundled,
vscode.Uri.joinPath(context.extensionUri, 'dist/browser/typescript-web/tsserver.web.js').toString(),
vscode.Uri.joinPath(context.extensionUri, 'dist/browser/typescript/tsserver.web.js').toString(),
API.fromSimpleString('4.2.0')));
const lazyClientHost = createLazyClientHost(context, false, {

View file

@ -175,7 +175,6 @@ export default class FileConfigurationManager extends Disposable {
const preferences: Proto.UserPreferences = {
quotePreference: this.getQuoteStylePreference(preferencesConfig),
// @ts-expect-error until TypeScript 4.2 API
importModuleSpecifierPreference: getImportModuleSpecifierPreference(preferencesConfig),
importModuleSpecifierEnding: getImportModuleSpecifierEndingPreference(preferencesConfig),
allowTextChangesInNewFiles: document.uri.scheme === fileSchemes.file,

View file

@ -693,7 +693,7 @@ export default class TypeScriptServiceClient extends Disposable implements IType
if (isWeb()) {
// On web, treat absolute paths as pointing to standard lib files
if (filepath.startsWith('/')) {
return vscode.Uri.joinPath(this.context.extensionUri, 'node_modules', 'typescript-web', 'lib', filepath.slice(1));
return vscode.Uri.joinPath(this.context.extensionUri, 'node_modules', 'typescript', 'lib', filepath.slice(1));
}
}

View file

@ -153,11 +153,6 @@ typescript-vscode-sh-plugin@^0.6.14:
resolved "https://registry.yarnpkg.com/typescript-vscode-sh-plugin/-/typescript-vscode-sh-plugin-0.6.14.tgz#a81031b502f6346a26ea49ce082438c3e353bb38"
integrity sha512-AkNlRBbI6K7gk29O92qthNSvc6jjmNQ6isVXoYxkFwPa8D04tIv2SOPd+sd+mNpso4tNdL2gy7nVtrd5yFqvlA==
"typescript-web@npm:typescript@^4.2.0-dev.20201209":
version "4.2.0-dev.20201209"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.2.0-dev.20201209.tgz#fab33fdb1aa7beb857271e0626bca6b200c61351"
integrity sha512-rXJtE/naraN9n3bPBDA5Sa/2nrx1di5se/kVkmAjhUSpBzGmx3zeNHZF59U8XhYQdQ1QsMiDDnjmtjFUGC9LEQ==
vscode-extension-telemetry@0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/vscode-extension-telemetry/-/vscode-extension-telemetry-0.1.1.tgz#91387e06b33400c57abd48979b0e790415ae110b"

View file

@ -2,7 +2,7 @@
# yarn lockfile v1
typescript@4.1.2:
version "4.1.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.1.2.tgz#6369ef22516fe5e10304aae5a5c4862db55380e9"
integrity sha512-thGloWsGH3SOxv1SoY7QojKi0tc+8FnOmiarEGMbd/lar7QOEd3hvlx3Fp5y6FlDUGl9L+pd4n2e+oToGMmhRQ==
typescript@^4.2.0-dev.20210201:
version "4.2.0-dev.20210201"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.2.0-dev.20210201.tgz#3d8ae7214cd4b23d3ae400f84d1afe5679f3e2f0"
integrity sha512-By8G30ZYs+b/8084cSnjP7ILd8ExUBC4Qi9FY2iRlBApHu/A08ExLlCRnYkHN1PgxcNs4rTaozJsgXHJ6cg92g==