tstyche 5.0.0 → 5.0.2
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/README.md +0 -4
- package/build/index.cjs +4 -4
- package/build/index.js +3 -3
- package/build/tstyche.js +25 -21
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -86,10 +86,6 @@ This simple! (And it has watch mode too.)
|
|
|
86
86
|
|
|
87
87
|
Visit [tstyche.org](https://tstyche.org) to view the full documentation.
|
|
88
88
|
|
|
89
|
-
## Feedback
|
|
90
|
-
|
|
91
|
-
If you have any questions or suggestions, [start a discussion](https://github.com/tstyche/tstyche/discussions/new/choose) or [open an issue](https://github.com/tstyche/tstyche/issues/new/choose) on GitHub. Preferring a chat? Join our [Discord server](https://discord.gg/gCSasd3QJq).
|
|
92
|
-
|
|
93
89
|
## License
|
|
94
90
|
|
|
95
91
|
[MIT][license-url] © TSTyche
|
package/build/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
function
|
|
3
|
+
function noop() {
|
|
4
4
|
}
|
|
5
|
-
const noopChain = new Proxy(
|
|
5
|
+
const noopChain = new Proxy(noop, {
|
|
6
6
|
apply() {
|
|
7
7
|
return noopChain;
|
|
8
8
|
},
|
|
@@ -14,7 +14,7 @@ const noopChain = new Proxy(doNothing, {
|
|
|
14
14
|
exports.describe = noopChain;
|
|
15
15
|
exports.expect = noopChain;
|
|
16
16
|
exports.it = noopChain;
|
|
17
|
-
exports.omit =
|
|
18
|
-
exports.pick =
|
|
17
|
+
exports.omit = noop;
|
|
18
|
+
exports.pick = noop;
|
|
19
19
|
exports.test = noopChain;
|
|
20
20
|
exports.when = noopChain;
|
package/build/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
function
|
|
1
|
+
function noop() {
|
|
2
2
|
}
|
|
3
|
-
const noopChain = new Proxy(
|
|
3
|
+
const noopChain = new Proxy(noop, {
|
|
4
4
|
apply() {
|
|
5
5
|
return noopChain;
|
|
6
6
|
},
|
|
@@ -9,4 +9,4 @@ const noopChain = new Proxy(doNothing, {
|
|
|
9
9
|
},
|
|
10
10
|
});
|
|
11
11
|
|
|
12
|
-
export { noopChain as describe, noopChain as expect, noopChain as it,
|
|
12
|
+
export { noopChain as describe, noopChain as expect, noopChain as it, noop as omit, noop as pick, noopChain as test, noopChain as when };
|
package/build/tstyche.js
CHANGED
|
@@ -950,25 +950,23 @@ class Store {
|
|
|
950
950
|
}
|
|
951
951
|
}
|
|
952
952
|
if (modulePath != null) {
|
|
953
|
-
|
|
953
|
+
const packageConfigText = await fs.readFile(Path.resolve(modulePath, "../../package.json"), { encoding: "utf8" });
|
|
954
|
+
const { version: packageVersion } = JSON.parse(packageConfigText);
|
|
955
|
+
if (!Version.isSatisfiedWith(packageVersion, "5.3")) {
|
|
956
|
+
modulePath = Path.resolve(modulePath, "../tsserverlibrary.js");
|
|
957
|
+
}
|
|
958
|
+
compilerInstance = await Store.#loadPatchedModule(modulePath);
|
|
954
959
|
Store.#compilerInstanceCache.set(tag, compilerInstance);
|
|
955
960
|
Store.#compilerInstanceCache.set(compilerInstance.version, compilerInstance);
|
|
956
961
|
}
|
|
957
962
|
return compilerInstance;
|
|
958
963
|
}
|
|
959
|
-
static async #
|
|
960
|
-
const exports = {};
|
|
961
|
-
const module = { exports };
|
|
962
|
-
const packageConfigText = await fs.readFile(Path.resolve(modulePath, "../../package.json"), { encoding: "utf8" });
|
|
963
|
-
const { version: packageVersion } = JSON.parse(packageConfigText);
|
|
964
|
-
if (!Version.isSatisfiedWith(packageVersion, "5.3")) {
|
|
965
|
-
modulePath = Path.resolve(modulePath, "../tsserverlibrary.js");
|
|
966
|
-
}
|
|
964
|
+
static async #loadPatchedModule(modulePath) {
|
|
967
965
|
const sourceText = await fs.readFile(modulePath, { encoding: "utf8" });
|
|
968
|
-
const
|
|
969
|
-
const
|
|
970
|
-
const
|
|
971
|
-
compiledWrapper(exports, createRequire(modulePath), module, modulePath, Path.dirname(modulePath));
|
|
966
|
+
const compiledWrapper = vm.compileFunction(sourceText.replace("return checker;", "return { ...checker, isTypeIdenticalTo };"), ["exports", "require", "module", "__filename", "__dirname"], { filename: modulePath });
|
|
967
|
+
const exports$1 = {};
|
|
968
|
+
const module = { exports: exports$1 };
|
|
969
|
+
compiledWrapper(exports$1, createRequire(modulePath), module, modulePath, Path.dirname(modulePath));
|
|
972
970
|
return module.exports;
|
|
973
971
|
}
|
|
974
972
|
static #onDiagnostics(diagnostic) {
|
|
@@ -3045,14 +3043,18 @@ class Select {
|
|
|
3045
3043
|
const entries = await fs.readdir(targetPath, { withFileTypes: true });
|
|
3046
3044
|
for (const entry of entries) {
|
|
3047
3045
|
let entryMeta = entry;
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3046
|
+
try {
|
|
3047
|
+
if (entry.isSymbolicLink()) {
|
|
3048
|
+
entryMeta = await fs.stat([targetPath, entry.name].join("/"));
|
|
3049
|
+
}
|
|
3050
|
+
if (entryMeta.isDirectory()) {
|
|
3051
|
+
directories.push(entry.name);
|
|
3052
|
+
}
|
|
3053
|
+
else if (entryMeta.isFile()) {
|
|
3054
|
+
files.push(entry.name);
|
|
3055
|
+
}
|
|
3053
3056
|
}
|
|
3054
|
-
|
|
3055
|
-
files.push(entry.name);
|
|
3057
|
+
catch {
|
|
3056
3058
|
}
|
|
3057
3059
|
}
|
|
3058
3060
|
}
|
|
@@ -4042,6 +4044,8 @@ class ProjectService {
|
|
|
4042
4044
|
}
|
|
4043
4045
|
#getDefaultCompilerOptions() {
|
|
4044
4046
|
const defaultCompilerOptions = {
|
|
4047
|
+
allowJs: true,
|
|
4048
|
+
checkJs: true,
|
|
4045
4049
|
allowImportingTsExtensions: true,
|
|
4046
4050
|
exactOptionalPropertyTypes: true,
|
|
4047
4051
|
jsx: this.#compiler.JsxEmit.Preserve,
|
|
@@ -5477,7 +5481,7 @@ class FileRunner {
|
|
|
5477
5481
|
class Runner {
|
|
5478
5482
|
#eventEmitter = new EventEmitter();
|
|
5479
5483
|
#resolvedConfig;
|
|
5480
|
-
static version = "5.0.
|
|
5484
|
+
static version = "5.0.2";
|
|
5481
5485
|
constructor(resolvedConfig) {
|
|
5482
5486
|
this.#resolvedConfig = resolvedConfig;
|
|
5483
5487
|
}
|