typescript 5.4.0-dev.20231114 → 5.4.0-dev.20231116
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/tsc.js +44 -23
- package/lib/tsserver.js +275 -196
- package/lib/typescript.d.ts +2 -0
- package/lib/typescript.js +266 -26
- package/lib/typingsInstaller.js +51 -31
- package/package.json +2 -2
package/lib/typingsInstaller.js
CHANGED
|
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
|
|
|
54
54
|
|
|
55
55
|
// src/compiler/corePublic.ts
|
|
56
56
|
var versionMajorMinor = "5.4";
|
|
57
|
-
var version = `${versionMajorMinor}.0-dev.
|
|
57
|
+
var version = `${versionMajorMinor}.0-dev.20231116`;
|
|
58
58
|
|
|
59
59
|
// src/compiler/core.ts
|
|
60
60
|
var emptyArray = [];
|
|
@@ -3934,6 +3934,7 @@ function createSystemWatchFunctions({
|
|
|
3934
3934
|
useNonPollingWatchers,
|
|
3935
3935
|
tscWatchDirectory,
|
|
3936
3936
|
inodeWatching,
|
|
3937
|
+
fsWatchWithTimestamp,
|
|
3937
3938
|
sysLog: sysLog2
|
|
3938
3939
|
}) {
|
|
3939
3940
|
const pollingWatches = /* @__PURE__ */ new Map();
|
|
@@ -4172,7 +4173,7 @@ function createSystemWatchFunctions({
|
|
|
4172
4173
|
return watchPresentFileSystemEntryWithFsWatchFile();
|
|
4173
4174
|
}
|
|
4174
4175
|
try {
|
|
4175
|
-
const presentWatcher = fsWatchWorker(
|
|
4176
|
+
const presentWatcher = (!fsWatchWithTimestamp ? fsWatchWorker : fsWatchWorkerHandlingTimestamp)(
|
|
4176
4177
|
fileOrDirectory,
|
|
4177
4178
|
recursive,
|
|
4178
4179
|
inodeWatching ? callbackChangingToMissingFileSystemEntry : callback
|
|
@@ -4235,6 +4236,18 @@ function createSystemWatchFunctions({
|
|
|
4235
4236
|
);
|
|
4236
4237
|
}
|
|
4237
4238
|
}
|
|
4239
|
+
function fsWatchWorkerHandlingTimestamp(fileOrDirectory, recursive, callback) {
|
|
4240
|
+
let modifiedTime = getModifiedTime2(fileOrDirectory) || missingFileModifiedTime;
|
|
4241
|
+
return fsWatchWorker(fileOrDirectory, recursive, (eventName, relativeFileName, currentModifiedTime) => {
|
|
4242
|
+
if (eventName === "change") {
|
|
4243
|
+
currentModifiedTime || (currentModifiedTime = getModifiedTime2(fileOrDirectory) || missingFileModifiedTime);
|
|
4244
|
+
if (currentModifiedTime.getTime() === modifiedTime.getTime())
|
|
4245
|
+
return;
|
|
4246
|
+
}
|
|
4247
|
+
modifiedTime = currentModifiedTime || getModifiedTime2(fileOrDirectory) || missingFileModifiedTime;
|
|
4248
|
+
callback(eventName, relativeFileName, modifiedTime);
|
|
4249
|
+
});
|
|
4250
|
+
}
|
|
4238
4251
|
}
|
|
4239
4252
|
function patchWriteFileEnsuringDirectory(sys2) {
|
|
4240
4253
|
const originalWriteFile = sys2.writeFile;
|
|
@@ -4263,12 +4276,13 @@ var sys = (() => {
|
|
|
4263
4276
|
let activeSession;
|
|
4264
4277
|
let profilePath = "./profile.cpuprofile";
|
|
4265
4278
|
const Buffer2 = require("buffer").Buffer;
|
|
4266
|
-
const
|
|
4279
|
+
const isMacOs = process.platform === "darwin";
|
|
4280
|
+
const isLinuxOrMacOs = process.platform === "linux" || isMacOs;
|
|
4267
4281
|
const platform = _os.platform();
|
|
4268
4282
|
const useCaseSensitiveFileNames2 = isFileSystemCaseSensitive();
|
|
4269
4283
|
const fsRealpath = !!_fs.realpathSync.native ? process.platform === "win32" ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync;
|
|
4270
4284
|
const executingFilePath = __filename.endsWith("sys.js") ? _path.join(_path.dirname(__dirname), "__fake__.js") : __filename;
|
|
4271
|
-
const fsSupportsRecursiveFsWatch = process.platform === "win32" ||
|
|
4285
|
+
const fsSupportsRecursiveFsWatch = process.platform === "win32" || isMacOs;
|
|
4272
4286
|
const getCurrentDirectory = memoize(() => process.cwd());
|
|
4273
4287
|
const { watchFile, watchDirectory } = createSystemWatchFunctions({
|
|
4274
4288
|
pollingWatchFileWorker: fsWatchFileWorker,
|
|
@@ -4288,6 +4302,7 @@ var sys = (() => {
|
|
|
4288
4302
|
useNonPollingWatchers: !!process.env.TSC_NONPOLLING_WATCHER,
|
|
4289
4303
|
tscWatchDirectory: process.env.TSC_WATCHDIRECTORY,
|
|
4290
4304
|
inodeWatching: isLinuxOrMacOs,
|
|
4305
|
+
fsWatchWithTimestamp: isMacOs,
|
|
4291
4306
|
sysLog
|
|
4292
4307
|
});
|
|
4293
4308
|
const nodeSystem = {
|
|
@@ -6044,6 +6059,7 @@ var Diagnostics = {
|
|
|
6044
6059
|
Type_0_is_generic_and_can_only_be_indexed_for_reading: diag(2862, 1 /* Error */, "Type_0_is_generic_and_can_only_be_indexed_for_reading_2862", "Type '{0}' is generic and can only be indexed for reading."),
|
|
6045
6060
|
A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values: diag(2863, 1 /* Error */, "A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values_2863", "A class cannot extend a primitive type like '{0}'. Classes can only extend constructable values."),
|
|
6046
6061
|
A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types: diag(2864, 1 /* Error */, "A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types_2864", "A class cannot implement a primitive type like '{0}'. It can only implement other named object types."),
|
|
6062
|
+
Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_is_enabled: diag(2865, 1 /* Error */, "Import_0_conflicts_with_local_value_so_must_be_declared_with_a_type_only_import_when_isolatedModules_2865", "Import '{0}' conflicts with local value, so must be declared with a type-only import when 'isolatedModules' is enabled."),
|
|
6047
6063
|
Import_declaration_0_is_using_private_name_1: diag(4e3, 1 /* Error */, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
|
|
6048
6064
|
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1 /* Error */, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
|
|
6049
6065
|
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1 /* Error */, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
|
|
@@ -13041,10 +13057,8 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
13041
13057
|
return update(updated, original);
|
|
13042
13058
|
}
|
|
13043
13059
|
function createNumericLiteral(value, numericLiteralFlags = 0 /* None */) {
|
|
13044
|
-
const text = typeof value === "number" ? value + "" : value;
|
|
13045
|
-
Debug.assert(text.charCodeAt(0) !== 45 /* minus */, "Negative numbers should be created in combination with createPrefixUnaryExpression");
|
|
13046
13060
|
const node = createBaseDeclaration(9 /* NumericLiteral */);
|
|
13047
|
-
node.text =
|
|
13061
|
+
node.text = typeof value === "number" ? value + "" : value;
|
|
13048
13062
|
node.numericLiteralFlags = numericLiteralFlags;
|
|
13049
13063
|
if (numericLiteralFlags & 384 /* BinaryOrOctalSpecifier */)
|
|
13050
13064
|
node.transformFlags |= 1024 /* ContainsES2015 */;
|
|
@@ -31850,6 +31864,32 @@ var TypingsInstaller = class {
|
|
|
31850
31864
|
}
|
|
31851
31865
|
this.processCacheLocation(this.globalCachePath);
|
|
31852
31866
|
}
|
|
31867
|
+
/** @internal */
|
|
31868
|
+
handleRequest(req) {
|
|
31869
|
+
switch (req.kind) {
|
|
31870
|
+
case "discover":
|
|
31871
|
+
this.install(req);
|
|
31872
|
+
break;
|
|
31873
|
+
case "closeProject":
|
|
31874
|
+
this.closeProject(req);
|
|
31875
|
+
break;
|
|
31876
|
+
case "typesRegistry": {
|
|
31877
|
+
const typesRegistry = {};
|
|
31878
|
+
this.typesRegistry.forEach((value, key) => {
|
|
31879
|
+
typesRegistry[key] = value;
|
|
31880
|
+
});
|
|
31881
|
+
const response = { kind: EventTypesRegistry, typesRegistry };
|
|
31882
|
+
this.sendResponse(response);
|
|
31883
|
+
break;
|
|
31884
|
+
}
|
|
31885
|
+
case "installPackage": {
|
|
31886
|
+
this.installPackage(req);
|
|
31887
|
+
break;
|
|
31888
|
+
}
|
|
31889
|
+
default:
|
|
31890
|
+
Debug.assertNever(req);
|
|
31891
|
+
}
|
|
31892
|
+
}
|
|
31853
31893
|
closeProject(req) {
|
|
31854
31894
|
this.closeWatchers(req.projectName);
|
|
31855
31895
|
}
|
|
@@ -31907,7 +31947,7 @@ var TypingsInstaller = class {
|
|
|
31907
31947
|
}
|
|
31908
31948
|
/** @internal */
|
|
31909
31949
|
installPackage(req) {
|
|
31910
|
-
const { fileName, packageName, projectName, projectRootPath } = req;
|
|
31950
|
+
const { fileName, packageName, projectName, projectRootPath, id } = req;
|
|
31911
31951
|
const cwd = forEachAncestorDirectory(getDirectoryPath(fileName), (directory) => {
|
|
31912
31952
|
if (this.installTypingHost.fileExists(combinePaths(directory, "package.json"))) {
|
|
31913
31953
|
return directory;
|
|
@@ -31919,6 +31959,7 @@ var TypingsInstaller = class {
|
|
|
31919
31959
|
const response = {
|
|
31920
31960
|
kind: ActionPackageInstalled,
|
|
31921
31961
|
projectName,
|
|
31962
|
+
id,
|
|
31922
31963
|
success,
|
|
31923
31964
|
message
|
|
31924
31965
|
};
|
|
@@ -31928,6 +31969,7 @@ var TypingsInstaller = class {
|
|
|
31928
31969
|
const response = {
|
|
31929
31970
|
kind: ActionPackageInstalled,
|
|
31930
31971
|
projectName,
|
|
31972
|
+
id,
|
|
31931
31973
|
success: false,
|
|
31932
31974
|
message: "Could not determine a project root path."
|
|
31933
31975
|
};
|
|
@@ -32267,29 +32309,7 @@ var NodeTypingsInstaller = class extends TypingsInstaller {
|
|
|
32267
32309
|
this.sendResponse(this.delayedInitializationError);
|
|
32268
32310
|
this.delayedInitializationError = void 0;
|
|
32269
32311
|
}
|
|
32270
|
-
|
|
32271
|
-
case "discover":
|
|
32272
|
-
this.install(req);
|
|
32273
|
-
break;
|
|
32274
|
-
case "closeProject":
|
|
32275
|
-
this.closeProject(req);
|
|
32276
|
-
break;
|
|
32277
|
-
case "typesRegistry": {
|
|
32278
|
-
const typesRegistry = {};
|
|
32279
|
-
this.typesRegistry.forEach((value, key) => {
|
|
32280
|
-
typesRegistry[key] = value;
|
|
32281
|
-
});
|
|
32282
|
-
const response = { kind: EventTypesRegistry, typesRegistry };
|
|
32283
|
-
this.sendResponse(response);
|
|
32284
|
-
break;
|
|
32285
|
-
}
|
|
32286
|
-
case "installPackage": {
|
|
32287
|
-
this.installPackage(req);
|
|
32288
|
-
break;
|
|
32289
|
-
}
|
|
32290
|
-
default:
|
|
32291
|
-
Debug.assertNever(req);
|
|
32292
|
-
}
|
|
32312
|
+
super.handleRequest(req);
|
|
32293
32313
|
}
|
|
32294
32314
|
sendResponse(response) {
|
|
32295
32315
|
if (this.log.isEnabled()) {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "typescript",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "5.4.0-dev.
|
|
5
|
+
"version": "5.4.0-dev.20231116",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -114,5 +114,5 @@
|
|
|
114
114
|
"node": "20.1.0",
|
|
115
115
|
"npm": "8.19.4"
|
|
116
116
|
},
|
|
117
|
-
"gitHead": "
|
|
117
|
+
"gitHead": "32b618c2d8f42948e7d6fa2e9b264079e30b5349"
|
|
118
118
|
}
|