@dcloudio/uni-app-x 0.7.79 → 0.7.81
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/package.json +1 -1
- package/types/dom2/UniCSSProperty.d.ts +0 -1
- package/types/dom2/UniCSSTransition.d.ts +30 -6
- package/types/dom2/UniElement.d.ts +5 -0
- package/types/dom2/UniNativeBaseView.d.ts +5 -3
- package/types/dom2/UniNativeDefines.d.ts +10 -10
- package/types/dom2/UniPage.d.ts +36 -3
- package/types/dom2/UniTextElement.d.ts +5 -0
- package/types/dom2/global.d.ts +21 -7
- package/types/dom2/sharedData.d.ts +10 -1
- package/types/dom2-internal/UniElement.d.ts +15 -0
- package/types/native/UniPage.d.ts +97 -1
- package/types/uni/uts-plugin-api/lib/uni-exit/utssdk/global.d.ts +7 -6
- package/types/uni/uts-plugin-api/lib/uni-exit/utssdk/index.d.ts +4 -3
- package/types/uni/uts-plugin-api/lib/uni-exit/utssdk/interface.d.ts +2 -1
- package/types/uni/uts-plugin-api/lib/uni-getSystemInfo/utssdk/global.d.ts +7 -6
- package/types/uni/uts-plugin-api/lib/uni-getSystemInfo/utssdk/index.d.ts +4 -3
- package/types/uni/uts-plugin-api/lib/uni-getSystemInfo/utssdk/interface.d.ts +69 -23
- package/types/uni/uts-plugin-api/lib/uni-media/utssdk/global.d.ts +7 -40
- package/types/uni/uts-plugin-api/lib/uni-media/utssdk/index.d.ts +4 -20
- package/types/uni/uts-plugin-api/lib/uni-media/utssdk/interface.d.ts +66 -495
- package/types/uni/uts-plugin-biz/lib/uni-crash/utssdk/global.d.ts +9 -8
- package/types/uni/uts-plugin-biz/lib/uni-crash/utssdk/index.d.ts +5 -4
- package/types/uni/uts-plugin-biz/lib/uni-crash/utssdk/interface.d.ts +29 -28
- package/types/uni/uts-plugin-component/lib/uni-web-view/utssdk/global.d.ts +10 -0
- package/types/uni/uts-plugin-component/lib/uni-web-view/utssdk/index.d.ts +5 -0
- package/types/uni/uts-plugin-component/lib/uni-web-view/utssdk/interface.d.ts +400 -212
- package/types/uni/uts-plugin-component/lib/uni-web-view-global/utssdk/interface.d.ts +5 -0
- package/types/node_modules/.package-lock.json +0 -20
- package/types/node_modules/typescript/LICENSE.txt +0 -55
- package/types/node_modules/typescript/ThirdPartyNoticeText.txt +0 -193
- package/types/node_modules/typescript/bin/tsc +0 -2
- package/types/node_modules/typescript/bin/tsserver +0 -2
- package/types/node_modules/typescript/lib/cancellationToken.js +0 -90
- package/types/node_modules/typescript/lib/cs/diagnosticMessages.generated.json +0 -1880
- package/types/node_modules/typescript/lib/de/diagnosticMessages.generated.json +0 -1880
- package/types/node_modules/typescript/lib/es/diagnosticMessages.generated.json +0 -1880
- package/types/node_modules/typescript/lib/fr/diagnosticMessages.generated.json +0 -1880
- package/types/node_modules/typescript/lib/it/diagnosticMessages.generated.json +0 -1880
- package/types/node_modules/typescript/lib/ja/diagnosticMessages.generated.json +0 -1880
- package/types/node_modules/typescript/lib/ko/diagnosticMessages.generated.json +0 -1880
- package/types/node_modules/typescript/lib/lib.d.ts +0 -22
- package/types/node_modules/typescript/lib/lib.decorators.d.ts +0 -386
- package/types/node_modules/typescript/lib/lib.decorators.legacy.d.ts +0 -22
- package/types/node_modules/typescript/lib/lib.dom.asynciterable.d.ts +0 -33
- package/types/node_modules/typescript/lib/lib.dom.d.ts +0 -28596
- package/types/node_modules/typescript/lib/lib.dom.iterable.d.ts +0 -475
- package/types/node_modules/typescript/lib/lib.es2015.collection.d.ts +0 -147
- package/types/node_modules/typescript/lib/lib.es2015.core.d.ts +0 -597
- package/types/node_modules/typescript/lib/lib.es2015.d.ts +0 -28
- package/types/node_modules/typescript/lib/lib.es2015.generator.d.ts +0 -77
- package/types/node_modules/typescript/lib/lib.es2015.iterable.d.ts +0 -495
- package/types/node_modules/typescript/lib/lib.es2015.promise.d.ts +0 -81
- package/types/node_modules/typescript/lib/lib.es2015.proxy.d.ts +0 -128
- package/types/node_modules/typescript/lib/lib.es2015.reflect.d.ts +0 -144
- package/types/node_modules/typescript/lib/lib.es2015.symbol.d.ts +0 -46
- package/types/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts +0 -326
- package/types/node_modules/typescript/lib/lib.es2016.array.include.d.ts +0 -116
- package/types/node_modules/typescript/lib/lib.es2016.d.ts +0 -21
- package/types/node_modules/typescript/lib/lib.es2016.full.d.ts +0 -23
- package/types/node_modules/typescript/lib/lib.es2016.intl.d.ts +0 -31
- package/types/node_modules/typescript/lib/lib.es2017.d.ts +0 -25
- package/types/node_modules/typescript/lib/lib.es2017.date.d.ts +0 -31
- package/types/node_modules/typescript/lib/lib.es2017.full.d.ts +0 -23
- package/types/node_modules/typescript/lib/lib.es2017.intl.d.ts +0 -44
- package/types/node_modules/typescript/lib/lib.es2017.object.d.ts +0 -49
- package/types/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts +0 -135
- package/types/node_modules/typescript/lib/lib.es2017.string.d.ts +0 -45
- package/types/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts +0 -53
- package/types/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts +0 -77
- package/types/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts +0 -43
- package/types/node_modules/typescript/lib/lib.es2018.d.ts +0 -24
- package/types/node_modules/typescript/lib/lib.es2018.full.d.ts +0 -24
- package/types/node_modules/typescript/lib/lib.es2018.intl.d.ts +0 -83
- package/types/node_modules/typescript/lib/lib.es2018.promise.d.ts +0 -30
- package/types/node_modules/typescript/lib/lib.es2018.regexp.d.ts +0 -37
- package/types/node_modules/typescript/lib/lib.es2019.array.d.ts +0 -79
- package/types/node_modules/typescript/lib/lib.es2019.d.ts +0 -24
- package/types/node_modules/typescript/lib/lib.es2019.full.d.ts +0 -24
- package/types/node_modules/typescript/lib/lib.es2019.intl.d.ts +0 -23
- package/types/node_modules/typescript/lib/lib.es2019.object.d.ts +0 -33
- package/types/node_modules/typescript/lib/lib.es2019.string.d.ts +0 -37
- package/types/node_modules/typescript/lib/lib.es2019.symbol.d.ts +0 -24
- package/types/node_modules/typescript/lib/lib.es2020.bigint.d.ts +0 -727
- package/types/node_modules/typescript/lib/lib.es2020.d.ts +0 -27
- package/types/node_modules/typescript/lib/lib.es2020.date.d.ts +0 -42
- package/types/node_modules/typescript/lib/lib.es2020.full.d.ts +0 -24
- package/types/node_modules/typescript/lib/lib.es2020.intl.d.ts +0 -474
- package/types/node_modules/typescript/lib/lib.es2020.number.d.ts +0 -28
- package/types/node_modules/typescript/lib/lib.es2020.promise.d.ts +0 -47
- package/types/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts +0 -97
- package/types/node_modules/typescript/lib/lib.es2020.string.d.ts +0 -42
- package/types/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts +0 -37
- package/types/node_modules/typescript/lib/lib.es2021.d.ts +0 -23
- package/types/node_modules/typescript/lib/lib.es2021.full.d.ts +0 -24
- package/types/node_modules/typescript/lib/lib.es2021.intl.d.ts +0 -166
- package/types/node_modules/typescript/lib/lib.es2021.promise.d.ts +0 -48
- package/types/node_modules/typescript/lib/lib.es2021.string.d.ts +0 -33
- package/types/node_modules/typescript/lib/lib.es2021.weakref.d.ts +0 -76
- package/types/node_modules/typescript/lib/lib.es2022.array.d.ts +0 -121
- package/types/node_modules/typescript/lib/lib.es2022.d.ts +0 -26
- package/types/node_modules/typescript/lib/lib.es2022.error.d.ts +0 -73
- package/types/node_modules/typescript/lib/lib.es2022.full.d.ts +0 -24
- package/types/node_modules/typescript/lib/lib.es2022.intl.d.ts +0 -117
- package/types/node_modules/typescript/lib/lib.es2022.object.d.ts +0 -26
- package/types/node_modules/typescript/lib/lib.es2022.regexp.d.ts +0 -39
- package/types/node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts +0 -39
- package/types/node_modules/typescript/lib/lib.es2022.string.d.ts +0 -25
- package/types/node_modules/typescript/lib/lib.es2023.array.d.ts +0 -924
- package/types/node_modules/typescript/lib/lib.es2023.collection.d.ts +0 -21
- package/types/node_modules/typescript/lib/lib.es2023.d.ts +0 -22
- package/types/node_modules/typescript/lib/lib.es2023.full.d.ts +0 -24
- package/types/node_modules/typescript/lib/lib.es2023.intl.d.ts +0 -56
- package/types/node_modules/typescript/lib/lib.es5.d.ts +0 -4585
- package/types/node_modules/typescript/lib/lib.es6.d.ts +0 -23
- package/types/node_modules/typescript/lib/lib.esnext.array.d.ts +0 -35
- package/types/node_modules/typescript/lib/lib.esnext.collection.d.ts +0 -106
- package/types/node_modules/typescript/lib/lib.esnext.d.ts +0 -28
- package/types/node_modules/typescript/lib/lib.esnext.decorators.d.ts +0 -28
- package/types/node_modules/typescript/lib/lib.esnext.disposable.d.ts +0 -185
- package/types/node_modules/typescript/lib/lib.esnext.full.d.ts +0 -24
- package/types/node_modules/typescript/lib/lib.esnext.intl.d.ts +0 -21
- package/types/node_modules/typescript/lib/lib.esnext.object.d.ts +0 -29
- package/types/node_modules/typescript/lib/lib.esnext.promise.d.ts +0 -35
- package/types/node_modules/typescript/lib/lib.esnext.regexp.d.ts +0 -25
- package/types/node_modules/typescript/lib/lib.esnext.string.d.ts +0 -29
- package/types/node_modules/typescript/lib/lib.scripthost.d.ts +0 -322
- package/types/node_modules/typescript/lib/lib.webworker.asynciterable.d.ts +0 -33
- package/types/node_modules/typescript/lib/lib.webworker.d.ts +0 -9431
- package/types/node_modules/typescript/lib/lib.webworker.importscripts.d.ts +0 -23
- package/types/node_modules/typescript/lib/lib.webworker.iterable.d.ts +0 -276
- package/types/node_modules/typescript/lib/pl/diagnosticMessages.generated.json +0 -1880
- package/types/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json +0 -1880
- package/types/node_modules/typescript/lib/ru/diagnosticMessages.generated.json +0 -1880
- package/types/node_modules/typescript/lib/tr/diagnosticMessages.generated.json +0 -1880
- package/types/node_modules/typescript/lib/tsc.js +0 -129741
- package/types/node_modules/typescript/lib/tsserver.js +0 -621
- package/types/node_modules/typescript/lib/tsserverlibrary.d.ts +0 -17
- package/types/node_modules/typescript/lib/tsserverlibrary.js +0 -21
- package/types/node_modules/typescript/lib/typesMap.json +0 -497
- package/types/node_modules/typescript/lib/typescript.d.ts +0 -11240
- package/types/node_modules/typescript/lib/typescript.js +0 -194910
- package/types/node_modules/typescript/lib/typingsInstaller.js +0 -236
- package/types/node_modules/typescript/lib/watchGuard.js +0 -53
- package/types/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json +0 -1880
- package/types/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json +0 -1880
- package/types/node_modules/typescript/package.json +0 -116
|
@@ -1,236 +0,0 @@
|
|
|
1
|
-
/*! *****************************************************************************
|
|
2
|
-
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
4
|
-
this file except in compliance with the License. You may obtain a copy of the
|
|
5
|
-
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
|
|
7
|
-
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
8
|
-
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
9
|
-
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
10
|
-
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
11
|
-
|
|
12
|
-
See the Apache Version 2.0 License for specific language governing permissions
|
|
13
|
-
and limitations under the License.
|
|
14
|
-
***************************************************************************** */
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"use strict";
|
|
18
|
-
var __create = Object.create;
|
|
19
|
-
var __defProp = Object.defineProperty;
|
|
20
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
21
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
22
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
23
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
24
|
-
var __export = (target, all) => {
|
|
25
|
-
for (var name in all)
|
|
26
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
27
|
-
};
|
|
28
|
-
var __copyProps = (to, from, except, desc) => {
|
|
29
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
30
|
-
for (let key of __getOwnPropNames(from))
|
|
31
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
32
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
33
|
-
}
|
|
34
|
-
return to;
|
|
35
|
-
};
|
|
36
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
37
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
38
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
39
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
40
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
41
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
42
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
43
|
-
mod
|
|
44
|
-
));
|
|
45
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
46
|
-
|
|
47
|
-
// src/typingsInstaller/nodeTypingsInstaller.ts
|
|
48
|
-
var nodeTypingsInstaller_exports = {};
|
|
49
|
-
__export(nodeTypingsInstaller_exports, {
|
|
50
|
-
NodeTypingsInstaller: () => NodeTypingsInstaller
|
|
51
|
-
});
|
|
52
|
-
module.exports = __toCommonJS(nodeTypingsInstaller_exports);
|
|
53
|
-
var fs = __toESM(require("fs"));
|
|
54
|
-
var path = __toESM(require("path"));
|
|
55
|
-
|
|
56
|
-
// src/typescript/typescript.ts
|
|
57
|
-
var typescript_exports = {};
|
|
58
|
-
__reExport(typescript_exports, require("./typescript.js"));
|
|
59
|
-
|
|
60
|
-
// src/typingsInstaller/nodeTypingsInstaller.ts
|
|
61
|
-
var FileLog = class {
|
|
62
|
-
constructor(logFile) {
|
|
63
|
-
this.logFile = logFile;
|
|
64
|
-
this.isEnabled = () => {
|
|
65
|
-
return typeof this.logFile === "string";
|
|
66
|
-
};
|
|
67
|
-
this.writeLine = (text) => {
|
|
68
|
-
if (typeof this.logFile !== "string") return;
|
|
69
|
-
try {
|
|
70
|
-
fs.appendFileSync(this.logFile, `[${typescript_exports.server.nowString()}] ${text}${typescript_exports.sys.newLine}`);
|
|
71
|
-
} catch (e) {
|
|
72
|
-
this.logFile = void 0;
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
function getDefaultNPMLocation(processName, validateDefaultNpmLocation2, host) {
|
|
78
|
-
if (path.basename(processName).indexOf("node") === 0) {
|
|
79
|
-
const npmPath = path.join(path.dirname(process.argv[0]), "npm");
|
|
80
|
-
if (!validateDefaultNpmLocation2) {
|
|
81
|
-
return npmPath;
|
|
82
|
-
}
|
|
83
|
-
if (host.fileExists(npmPath)) {
|
|
84
|
-
return `"${npmPath}"`;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
return "npm";
|
|
88
|
-
}
|
|
89
|
-
function loadTypesRegistryFile(typesRegistryFilePath, host, log2) {
|
|
90
|
-
if (!host.fileExists(typesRegistryFilePath)) {
|
|
91
|
-
if (log2.isEnabled()) {
|
|
92
|
-
log2.writeLine(`Types registry file '${typesRegistryFilePath}' does not exist`);
|
|
93
|
-
}
|
|
94
|
-
return /* @__PURE__ */ new Map();
|
|
95
|
-
}
|
|
96
|
-
try {
|
|
97
|
-
const content = JSON.parse(host.readFile(typesRegistryFilePath));
|
|
98
|
-
return new Map(Object.entries(content.entries));
|
|
99
|
-
} catch (e) {
|
|
100
|
-
if (log2.isEnabled()) {
|
|
101
|
-
log2.writeLine(`Error when loading types registry file '${typesRegistryFilePath}': ${e.message}, ${e.stack}`);
|
|
102
|
-
}
|
|
103
|
-
return /* @__PURE__ */ new Map();
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
var typesRegistryPackageName = "types-registry";
|
|
107
|
-
function getTypesRegistryFileLocation(globalTypingsCacheLocation2) {
|
|
108
|
-
return (0, typescript_exports.combinePaths)((0, typescript_exports.normalizeSlashes)(globalTypingsCacheLocation2), `node_modules/${typesRegistryPackageName}/index.json`);
|
|
109
|
-
}
|
|
110
|
-
var NodeTypingsInstaller = class extends typescript_exports.server.typingsInstaller.TypingsInstaller {
|
|
111
|
-
constructor(globalTypingsCacheLocation2, typingSafeListLocation2, typesMapLocation2, npmLocation2, validateDefaultNpmLocation2, throttleLimit, log2) {
|
|
112
|
-
const libDirectory = (0, typescript_exports.getDirectoryPath)((0, typescript_exports.normalizePath)(typescript_exports.sys.getExecutingFilePath()));
|
|
113
|
-
super(
|
|
114
|
-
typescript_exports.sys,
|
|
115
|
-
globalTypingsCacheLocation2,
|
|
116
|
-
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)),
|
|
117
|
-
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)),
|
|
118
|
-
throttleLimit,
|
|
119
|
-
log2
|
|
120
|
-
);
|
|
121
|
-
this.npmPath = npmLocation2 !== void 0 ? npmLocation2 : getDefaultNPMLocation(process.argv[0], validateDefaultNpmLocation2, this.installTypingHost);
|
|
122
|
-
if (this.npmPath.includes(" ") && this.npmPath[0] !== `"`) {
|
|
123
|
-
this.npmPath = `"${this.npmPath}"`;
|
|
124
|
-
}
|
|
125
|
-
if (this.log.isEnabled()) {
|
|
126
|
-
this.log.writeLine(`Process id: ${process.pid}`);
|
|
127
|
-
this.log.writeLine(`NPM location: ${this.npmPath} (explicit '${typescript_exports.server.Arguments.NpmLocation}' ${npmLocation2 === void 0 ? "not " : ""} provided)`);
|
|
128
|
-
this.log.writeLine(`validateDefaultNpmLocation: ${validateDefaultNpmLocation2}`);
|
|
129
|
-
}
|
|
130
|
-
({ execSync: this.nodeExecSync } = require("child_process"));
|
|
131
|
-
this.ensurePackageDirectoryExists(globalTypingsCacheLocation2);
|
|
132
|
-
try {
|
|
133
|
-
if (this.log.isEnabled()) {
|
|
134
|
-
this.log.writeLine(`Updating ${typesRegistryPackageName} npm package...`);
|
|
135
|
-
}
|
|
136
|
-
this.execSyncAndLog(`${this.npmPath} install --ignore-scripts ${typesRegistryPackageName}@${this.latestDistTag}`, { cwd: globalTypingsCacheLocation2 });
|
|
137
|
-
if (this.log.isEnabled()) {
|
|
138
|
-
this.log.writeLine(`Updated ${typesRegistryPackageName} npm package`);
|
|
139
|
-
}
|
|
140
|
-
} catch (e) {
|
|
141
|
-
if (this.log.isEnabled()) {
|
|
142
|
-
this.log.writeLine(`Error updating ${typesRegistryPackageName} package: ${e.message}`);
|
|
143
|
-
}
|
|
144
|
-
this.delayedInitializationError = {
|
|
145
|
-
kind: "event::initializationFailed",
|
|
146
|
-
message: e.message,
|
|
147
|
-
stack: e.stack
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
this.typesRegistry = loadTypesRegistryFile(getTypesRegistryFileLocation(globalTypingsCacheLocation2), this.installTypingHost, this.log);
|
|
151
|
-
}
|
|
152
|
-
handleRequest(req) {
|
|
153
|
-
if (this.delayedInitializationError) {
|
|
154
|
-
this.sendResponse(this.delayedInitializationError);
|
|
155
|
-
this.delayedInitializationError = void 0;
|
|
156
|
-
}
|
|
157
|
-
super.handleRequest(req);
|
|
158
|
-
}
|
|
159
|
-
sendResponse(response) {
|
|
160
|
-
if (this.log.isEnabled()) {
|
|
161
|
-
this.log.writeLine(`Sending response:${typescript_exports.server.stringifyIndented(response)}`);
|
|
162
|
-
}
|
|
163
|
-
process.send(response);
|
|
164
|
-
if (this.log.isEnabled()) {
|
|
165
|
-
this.log.writeLine(`Response has been sent.`);
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
installWorker(requestId, packageNames, cwd, onRequestCompleted) {
|
|
169
|
-
if (this.log.isEnabled()) {
|
|
170
|
-
this.log.writeLine(`#${requestId} with cwd: ${cwd} arguments: ${JSON.stringify(packageNames)}`);
|
|
171
|
-
}
|
|
172
|
-
const start = Date.now();
|
|
173
|
-
const hasError = typescript_exports.server.typingsInstaller.installNpmPackages(this.npmPath, typescript_exports.version, packageNames, (command) => this.execSyncAndLog(command, { cwd }));
|
|
174
|
-
if (this.log.isEnabled()) {
|
|
175
|
-
this.log.writeLine(`npm install #${requestId} took: ${Date.now() - start} ms`);
|
|
176
|
-
}
|
|
177
|
-
onRequestCompleted(!hasError);
|
|
178
|
-
}
|
|
179
|
-
/** Returns 'true' in case of error. */
|
|
180
|
-
execSyncAndLog(command, options) {
|
|
181
|
-
if (this.log.isEnabled()) {
|
|
182
|
-
this.log.writeLine(`Exec: ${command}`);
|
|
183
|
-
}
|
|
184
|
-
try {
|
|
185
|
-
const stdout = this.nodeExecSync(command, { ...options, encoding: "utf-8" });
|
|
186
|
-
if (this.log.isEnabled()) {
|
|
187
|
-
this.log.writeLine(` Succeeded. stdout:${indent(typescript_exports.sys.newLine, stdout)}`);
|
|
188
|
-
}
|
|
189
|
-
return false;
|
|
190
|
-
} catch (error) {
|
|
191
|
-
const { stdout, stderr } = error;
|
|
192
|
-
this.log.writeLine(` Failed. stdout:${indent(typescript_exports.sys.newLine, stdout)}${typescript_exports.sys.newLine} stderr:${indent(typescript_exports.sys.newLine, stderr)}`);
|
|
193
|
-
return true;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
};
|
|
197
|
-
var logFilePath = typescript_exports.server.findArgument(typescript_exports.server.Arguments.LogFile);
|
|
198
|
-
var globalTypingsCacheLocation = typescript_exports.server.findArgument(typescript_exports.server.Arguments.GlobalCacheLocation);
|
|
199
|
-
var typingSafeListLocation = typescript_exports.server.findArgument(typescript_exports.server.Arguments.TypingSafeListLocation);
|
|
200
|
-
var typesMapLocation = typescript_exports.server.findArgument(typescript_exports.server.Arguments.TypesMapLocation);
|
|
201
|
-
var npmLocation = typescript_exports.server.findArgument(typescript_exports.server.Arguments.NpmLocation);
|
|
202
|
-
var validateDefaultNpmLocation = typescript_exports.server.hasArgument(typescript_exports.server.Arguments.ValidateDefaultNpmLocation);
|
|
203
|
-
var log = new FileLog(logFilePath);
|
|
204
|
-
if (log.isEnabled()) {
|
|
205
|
-
process.on("uncaughtException", (e) => {
|
|
206
|
-
log.writeLine(`Unhandled exception: ${e} at ${e.stack}`);
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
process.on("disconnect", () => {
|
|
210
|
-
if (log.isEnabled()) {
|
|
211
|
-
log.writeLine(`Parent process has exited, shutting down...`);
|
|
212
|
-
}
|
|
213
|
-
process.exit(0);
|
|
214
|
-
});
|
|
215
|
-
var installer;
|
|
216
|
-
process.on("message", (req) => {
|
|
217
|
-
installer ?? (installer = new NodeTypingsInstaller(
|
|
218
|
-
globalTypingsCacheLocation,
|
|
219
|
-
typingSafeListLocation,
|
|
220
|
-
typesMapLocation,
|
|
221
|
-
npmLocation,
|
|
222
|
-
validateDefaultNpmLocation,
|
|
223
|
-
/*throttleLimit*/
|
|
224
|
-
5,
|
|
225
|
-
log
|
|
226
|
-
));
|
|
227
|
-
installer.handleRequest(req);
|
|
228
|
-
});
|
|
229
|
-
function indent(newline, str) {
|
|
230
|
-
return str && str.length ? `${newline} ` + str.replace(/\r?\n/, `${newline} `) : "";
|
|
231
|
-
}
|
|
232
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
233
|
-
0 && (module.exports = {
|
|
234
|
-
NodeTypingsInstaller
|
|
235
|
-
});
|
|
236
|
-
//# sourceMappingURL=typingsInstaller.js.map
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/*! *****************************************************************************
|
|
2
|
-
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
4
|
-
this file except in compliance with the License. You may obtain a copy of the
|
|
5
|
-
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
-
|
|
7
|
-
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
8
|
-
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
9
|
-
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
10
|
-
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
11
|
-
|
|
12
|
-
See the Apache Version 2.0 License for specific language governing permissions
|
|
13
|
-
and limitations under the License.
|
|
14
|
-
***************************************************************************** */
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"use strict";
|
|
18
|
-
var __create = Object.create;
|
|
19
|
-
var __defProp = Object.defineProperty;
|
|
20
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
21
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
22
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
23
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
24
|
-
var __copyProps = (to, from, except, desc) => {
|
|
25
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
26
|
-
for (let key of __getOwnPropNames(from))
|
|
27
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
28
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
29
|
-
}
|
|
30
|
-
return to;
|
|
31
|
-
};
|
|
32
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
33
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
34
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
35
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
36
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
37
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
38
|
-
mod
|
|
39
|
-
));
|
|
40
|
-
|
|
41
|
-
// src/watchGuard/watchGuard.ts
|
|
42
|
-
var fs = __toESM(require("fs"));
|
|
43
|
-
if (process.argv.length < 3) {
|
|
44
|
-
process.exit(1);
|
|
45
|
-
}
|
|
46
|
-
var directoryName = process.argv[2];
|
|
47
|
-
try {
|
|
48
|
-
const watcher = fs.watch(directoryName, { recursive: true }, () => ({}));
|
|
49
|
-
watcher.close();
|
|
50
|
-
} catch {
|
|
51
|
-
}
|
|
52
|
-
process.exit(0);
|
|
53
|
-
//# sourceMappingURL=watchGuard.js.map
|