typescript 5.5.0-dev.20240319 → 5.5.0-dev.20240321
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/lib.esnext.array.d.ts +35 -0
- package/lib/lib.esnext.d.ts +1 -0
- package/lib/tsc.js +130 -401
- package/lib/tsserver.js +108 -114
- package/lib/typescript.d.ts +1 -0
- package/lib/typescript.js +141 -372
- package/lib/typingsInstaller.js +18 -24
- package/package.json +2 -2
package/lib/typingsInstaller.js
CHANGED
|
@@ -53,16 +53,10 @@ module.exports = __toCommonJS(nodeTypingsInstaller_exports);
|
|
|
53
53
|
var fs = __toESM(require("fs"));
|
|
54
54
|
var path = __toESM(require("path"));
|
|
55
55
|
|
|
56
|
-
// src/typingsInstaller/_namespaces/ts.ts
|
|
57
|
-
var ts_exports = {};
|
|
58
|
-
|
|
59
56
|
// src/typescript/typescript.ts
|
|
60
57
|
var typescript_exports = {};
|
|
61
58
|
__reExport(typescript_exports, require("./typescript.js"));
|
|
62
59
|
|
|
63
|
-
// src/typingsInstaller/_namespaces/ts.ts
|
|
64
|
-
__reExport(ts_exports, typescript_exports);
|
|
65
|
-
|
|
66
60
|
// src/typingsInstaller/nodeTypingsInstaller.ts
|
|
67
61
|
var FileLog = class {
|
|
68
62
|
constructor(logFile) {
|
|
@@ -74,7 +68,7 @@ var FileLog = class {
|
|
|
74
68
|
if (typeof this.logFile !== "string")
|
|
75
69
|
return;
|
|
76
70
|
try {
|
|
77
|
-
fs.appendFileSync(this.logFile, `[${
|
|
71
|
+
fs.appendFileSync(this.logFile, `[${typescript_exports.server.nowString()}] ${text}${typescript_exports.sys.newLine}`);
|
|
78
72
|
} catch (e) {
|
|
79
73
|
this.logFile = void 0;
|
|
80
74
|
}
|
|
@@ -112,16 +106,16 @@ function loadTypesRegistryFile(typesRegistryFilePath, host, log2) {
|
|
|
112
106
|
}
|
|
113
107
|
var typesRegistryPackageName = "types-registry";
|
|
114
108
|
function getTypesRegistryFileLocation(globalTypingsCacheLocation2) {
|
|
115
|
-
return (0,
|
|
109
|
+
return (0, typescript_exports.combinePaths)((0, typescript_exports.normalizeSlashes)(globalTypingsCacheLocation2), `node_modules/${typesRegistryPackageName}/index.json`);
|
|
116
110
|
}
|
|
117
|
-
var NodeTypingsInstaller = class extends
|
|
111
|
+
var NodeTypingsInstaller = class extends typescript_exports.server.typingsInstaller.TypingsInstaller {
|
|
118
112
|
constructor(globalTypingsCacheLocation2, typingSafeListLocation2, typesMapLocation2, npmLocation2, validateDefaultNpmLocation2, throttleLimit, log2) {
|
|
119
|
-
const libDirectory = (0,
|
|
113
|
+
const libDirectory = (0, typescript_exports.getDirectoryPath)((0, typescript_exports.normalizePath)(typescript_exports.sys.getExecutingFilePath()));
|
|
120
114
|
super(
|
|
121
|
-
|
|
115
|
+
typescript_exports.sys,
|
|
122
116
|
globalTypingsCacheLocation2,
|
|
123
|
-
typingSafeListLocation2 ? (0,
|
|
124
|
-
typesMapLocation2 ? (0,
|
|
117
|
+
typingSafeListLocation2 ? (0, typescript_exports.toPath)(typingSafeListLocation2, "", (0, typescript_exports.createGetCanonicalFileName)(typescript_exports.sys.useCaseSensitiveFileNames)) : (0, typescript_exports.toPath)("typingSafeList.json", libDirectory, (0, typescript_exports.createGetCanonicalFileName)(typescript_exports.sys.useCaseSensitiveFileNames)),
|
|
118
|
+
typesMapLocation2 ? (0, typescript_exports.toPath)(typesMapLocation2, "", (0, typescript_exports.createGetCanonicalFileName)(typescript_exports.sys.useCaseSensitiveFileNames)) : (0, typescript_exports.toPath)("typesMap.json", libDirectory, (0, typescript_exports.createGetCanonicalFileName)(typescript_exports.sys.useCaseSensitiveFileNames)),
|
|
125
119
|
throttleLimit,
|
|
126
120
|
log2
|
|
127
121
|
);
|
|
@@ -131,7 +125,7 @@ var NodeTypingsInstaller = class extends ts_exports.server.typingsInstaller.Typi
|
|
|
131
125
|
}
|
|
132
126
|
if (this.log.isEnabled()) {
|
|
133
127
|
this.log.writeLine(`Process id: ${process.pid}`);
|
|
134
|
-
this.log.writeLine(`NPM location: ${this.npmPath} (explicit '${
|
|
128
|
+
this.log.writeLine(`NPM location: ${this.npmPath} (explicit '${typescript_exports.server.Arguments.NpmLocation}' ${npmLocation2 === void 0 ? "not " : ""} provided)`);
|
|
135
129
|
this.log.writeLine(`validateDefaultNpmLocation: ${validateDefaultNpmLocation2}`);
|
|
136
130
|
}
|
|
137
131
|
({ execSync: this.nodeExecSync } = require("child_process"));
|
|
@@ -165,7 +159,7 @@ var NodeTypingsInstaller = class extends ts_exports.server.typingsInstaller.Typi
|
|
|
165
159
|
}
|
|
166
160
|
sendResponse(response) {
|
|
167
161
|
if (this.log.isEnabled()) {
|
|
168
|
-
this.log.writeLine(`Sending response:${
|
|
162
|
+
this.log.writeLine(`Sending response:${typescript_exports.server.stringifyIndented(response)}`);
|
|
169
163
|
}
|
|
170
164
|
process.send(response);
|
|
171
165
|
if (this.log.isEnabled()) {
|
|
@@ -177,7 +171,7 @@ var NodeTypingsInstaller = class extends ts_exports.server.typingsInstaller.Typi
|
|
|
177
171
|
this.log.writeLine(`#${requestId} with cwd: ${cwd} arguments: ${JSON.stringify(packageNames)}`);
|
|
178
172
|
}
|
|
179
173
|
const start = Date.now();
|
|
180
|
-
const hasError =
|
|
174
|
+
const hasError = typescript_exports.server.typingsInstaller.installNpmPackages(this.npmPath, typescript_exports.version, packageNames, (command) => this.execSyncAndLog(command, { cwd }));
|
|
181
175
|
if (this.log.isEnabled()) {
|
|
182
176
|
this.log.writeLine(`npm install #${requestId} took: ${Date.now() - start} ms`);
|
|
183
177
|
}
|
|
@@ -191,22 +185,22 @@ var NodeTypingsInstaller = class extends ts_exports.server.typingsInstaller.Typi
|
|
|
191
185
|
try {
|
|
192
186
|
const stdout = this.nodeExecSync(command, { ...options, encoding: "utf-8" });
|
|
193
187
|
if (this.log.isEnabled()) {
|
|
194
|
-
this.log.writeLine(` Succeeded. stdout:${indent(
|
|
188
|
+
this.log.writeLine(` Succeeded. stdout:${indent(typescript_exports.sys.newLine, stdout)}`);
|
|
195
189
|
}
|
|
196
190
|
return false;
|
|
197
191
|
} catch (error) {
|
|
198
192
|
const { stdout, stderr } = error;
|
|
199
|
-
this.log.writeLine(` Failed. stdout:${indent(
|
|
193
|
+
this.log.writeLine(` Failed. stdout:${indent(typescript_exports.sys.newLine, stdout)}${typescript_exports.sys.newLine} stderr:${indent(typescript_exports.sys.newLine, stderr)}`);
|
|
200
194
|
return true;
|
|
201
195
|
}
|
|
202
196
|
}
|
|
203
197
|
};
|
|
204
|
-
var logFilePath =
|
|
205
|
-
var globalTypingsCacheLocation =
|
|
206
|
-
var typingSafeListLocation =
|
|
207
|
-
var typesMapLocation =
|
|
208
|
-
var npmLocation =
|
|
209
|
-
var validateDefaultNpmLocation =
|
|
198
|
+
var logFilePath = typescript_exports.server.findArgument(typescript_exports.server.Arguments.LogFile);
|
|
199
|
+
var globalTypingsCacheLocation = typescript_exports.server.findArgument(typescript_exports.server.Arguments.GlobalCacheLocation);
|
|
200
|
+
var typingSafeListLocation = typescript_exports.server.findArgument(typescript_exports.server.Arguments.TypingSafeListLocation);
|
|
201
|
+
var typesMapLocation = typescript_exports.server.findArgument(typescript_exports.server.Arguments.TypesMapLocation);
|
|
202
|
+
var npmLocation = typescript_exports.server.findArgument(typescript_exports.server.Arguments.NpmLocation);
|
|
203
|
+
var validateDefaultNpmLocation = typescript_exports.server.hasArgument(typescript_exports.server.Arguments.ValidateDefaultNpmLocation);
|
|
210
204
|
var log = new FileLog(logFilePath);
|
|
211
205
|
if (log.isEnabled()) {
|
|
212
206
|
process.on("uncaughtException", (e) => {
|
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.5.0-dev.
|
|
5
|
+
"version": "5.5.0-dev.20240321",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|
|
@@ -112,5 +112,5 @@
|
|
|
112
112
|
"node": "20.1.0",
|
|
113
113
|
"npm": "8.19.4"
|
|
114
114
|
},
|
|
115
|
-
"gitHead": "
|
|
115
|
+
"gitHead": "dc113f8170bc9408961e4e89f1ffadf3dff5a41b"
|
|
116
116
|
}
|