@effect/tsgo 0.56.1 → 0.59.0
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 +33 -12
- package/dist/effect-tsgo.cjs +408 -33
- package/package.json +8 -8
- package/schema.json +41 -0
package/README.md
CHANGED
|
@@ -3,6 +3,19 @@
|
|
|
3
3
|
A wrapper around [TypeScript-Go](https://github.com/microsoft/TypeScript-Go) that builds the Effect Language Service, providing Effect-TS diagnostics and quick fixes.
|
|
4
4
|
This project targets **Effect V4** (codename: "smol") primarily and also Effect V3.
|
|
5
5
|
|
|
6
|
+
<!-- supported-components:start -->
|
|
7
|
+
## Supported Package Versions
|
|
8
|
+
|
|
9
|
+
The following target package versions are supported by `@effect/tsgo@0.59.0`:
|
|
10
|
+
|
|
11
|
+
| Component | Supported versions |
|
|
12
|
+
|---|---|
|
|
13
|
+
| TypeScript | `7.0.2`, `7.1.0-beta`, `7.1.0-dev.20261026.1` |
|
|
14
|
+
| tsrs | `0.20.0-ts7.1.0-beta` |
|
|
15
|
+
| Oxlint | `1.87.0`, `1.88.0`, `1.89.0` |
|
|
16
|
+
| oxlint-tsgolint | `7.0.2004`, `7.0.2005` |
|
|
17
|
+
<!-- supported-components:end -->
|
|
18
|
+
|
|
6
19
|
## Installation
|
|
7
20
|
|
|
8
21
|
The setup of the TSGO version of the LSP can be performed via the command line interface:
|
|
@@ -23,6 +36,26 @@ This will guide you through the installation process, which includes:
|
|
|
23
36
|
> [!NOTE]
|
|
24
37
|
> At the moment, you still need a native TypeScript install alongside `@effect/tsgo`: `typescript` >= 7 (e.g. `typescript@latest` or `typescript@next`) or an alias such as `@typescript/native`. `effect-tsgo patch` tries `typescript`, then `@typescript/native`, and accepts `--typescript-package <name>` to try a custom package name first.
|
|
25
38
|
|
|
39
|
+
### Run the patched tools without patching
|
|
40
|
+
|
|
41
|
+
`effect-tsgo patch` rewrites files inside `node_modules`, which is not possible (or not desirable) with shared or read-only package stores, such as the pnpm global virtual store, Yarn PnP or Nix. Instead, `effect-tsgo` can run the Effect-patched builds it ships directly, leaving `node_modules` untouched:
|
|
42
|
+
|
|
43
|
+
```sh
|
|
44
|
+
effect-tsgo tsc -p tsconfig.json # the Effect-patched tsc
|
|
45
|
+
effect-tsgo tsc@7.0.2 --lsp --stdio # a specific TypeScript version
|
|
46
|
+
effect-tsgo tsc@next --build # or an upstream tag: latest, beta, next
|
|
47
|
+
effect-tsgo tsrs --noEmit # the Effect-patched tsrs (tsrs@<version> and tsrs@latest work too)
|
|
48
|
+
effect-tsgo oxlint --type-aware # Oxlint with the Effect rules
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Every argument after the tool is passed through unchanged, so the commands work as drop-in replacements in `package.json` scripts and editor settings that launch `tsc`.
|
|
52
|
+
|
|
53
|
+
- `tsc` and `tsrs` run the requested version or tag; without one they run the build of the installed `typescript`/`@typescript/native` (>= 7) or `tsrs` version when this release ships it, and otherwise the latest supported version. They do not require TypeScript or tsrs to be installed.
|
|
54
|
+
- `oxlint` runs the CLI of the installed `oxlint` package (installed directly or through `vite-plus`) with the Effect-patched native binding and, when `oxlint-tsgolint` is installed, the Effect-patched `tsgolint` of the installed versions. It does not accept a version.
|
|
55
|
+
- As with `patch`, the packaged `tsrs` and `oxlint` builds do not support Linux musl.
|
|
56
|
+
|
|
57
|
+
Prefer these commands whenever you cannot or do not want to modify `node_modules`; prefer `patch` when other tools must keep launching the stock binaries (for example `npx tsc`, or editor extensions that resolve the TypeScript package). Note that the type augmentation that adds the `effecttsgo` plugin and rules to Oxlint's config types (for `oxlint.config.ts`) is applied only by `patch`.
|
|
58
|
+
|
|
26
59
|
## LSP-based linter
|
|
27
60
|
|
|
28
61
|
The Effect LSP doubles as a tool to perform type-aware linting of Effect code, and ships as well a way to emit additional Oxlint Type Aware rules.
|
|
@@ -35,18 +68,6 @@ When running in `tsc` mode, the Effect diagnostics are emitted as standard TypeS
|
|
|
35
68
|
|
|
36
69
|
When running in dedicated diagnostics mode, the Effect diagnostics can be emitted in structured formats, which can be further processed by other tools.
|
|
37
70
|
|
|
38
|
-
<!-- supported-components:start -->
|
|
39
|
-
## Supported Package Versions
|
|
40
|
-
|
|
41
|
-
The following target package versions are supported by `@effect/tsgo@0.56.1`:
|
|
42
|
-
|
|
43
|
-
| Component | Supported versions |
|
|
44
|
-
|---|---|
|
|
45
|
-
| TypeScript | `7.0.2`, `7.1.0-beta`, `7.1.0-dev.20261023.1` |
|
|
46
|
-
| Oxlint | `1.87.0`, `1.88.0`, `1.89.0` |
|
|
47
|
-
| oxlint-tsgolint | `7.0.2004`, `7.0.2005` |
|
|
48
|
-
<!-- supported-components:end -->
|
|
49
|
-
|
|
50
71
|
## Diagnostic Status
|
|
51
72
|
|
|
52
73
|
Some diagnostics are off by default or have a default severity of suggestion, but you can always enable them or change their default severity in the plugin options.
|
package/dist/effect-tsgo.cjs
CHANGED
|
@@ -44,6 +44,7 @@ let node_readline = require("node:readline");
|
|
|
44
44
|
node_readline = __toESM(node_readline);
|
|
45
45
|
let node_module = require("node:module");
|
|
46
46
|
node_module = __toESM(node_module);
|
|
47
|
+
let node_fs_promises = require("node:fs/promises");
|
|
47
48
|
|
|
48
49
|
//#region ../../node_modules/.pnpm/effect@4.0.2/node_modules/effect/dist/Pipeable.js
|
|
49
50
|
/**
|
|
@@ -38020,7 +38021,7 @@ const positionToNumber = (position, method) => try_({
|
|
|
38020
38021
|
try: () => bigintToNumber(position, "position"),
|
|
38021
38022
|
catch: handleBadArgument(method)
|
|
38022
38023
|
});
|
|
38023
|
-
const access = /* @__PURE__ */ (() => {
|
|
38024
|
+
const access$1 = /* @__PURE__ */ (() => {
|
|
38024
38025
|
const nodeAccess = /* @__PURE__ */ effectify(node_fs.access, /* @__PURE__ */ handleErrnoException("FileSystem", "access"), /* @__PURE__ */ handleBadArgument("access"));
|
|
38025
38026
|
return (path, options) => {
|
|
38026
38027
|
let mode = node_fs.constants.F_OK;
|
|
@@ -38338,7 +38339,7 @@ const writeFile = (path, data, options) => callback$1((resume, signal) => {
|
|
|
38338
38339
|
}
|
|
38339
38340
|
});
|
|
38340
38341
|
const makeFileSystem = /* @__PURE__ */ map$5(/* @__PURE__ */ serviceOption(WatchBackend), (backend) => make$19({
|
|
38341
|
-
access,
|
|
38342
|
+
access: access$1,
|
|
38342
38343
|
chmod,
|
|
38343
38344
|
chown,
|
|
38344
38345
|
copy,
|
|
@@ -52481,6 +52482,37 @@ const withDescription = /* @__PURE__ */ dual(2, (self, description) => makeComma
|
|
|
52481
52482
|
...toImpl(self),
|
|
52482
52483
|
description
|
|
52483
52484
|
}));
|
|
52485
|
+
/**
|
|
52486
|
+
* Sets usage examples for a command.
|
|
52487
|
+
*
|
|
52488
|
+
* **Details**
|
|
52489
|
+
*
|
|
52490
|
+
* Examples are exposed in structured `HelpDoc` data and rendered by the
|
|
52491
|
+
* default formatter in an `EXAMPLES` section.
|
|
52492
|
+
*
|
|
52493
|
+
* **Example** (Adding usage examples)
|
|
52494
|
+
*
|
|
52495
|
+
* ```ts import.meta.vitest
|
|
52496
|
+
* import { Command } from "effect/cli"
|
|
52497
|
+
*
|
|
52498
|
+
* const login = Command.make("login").pipe(
|
|
52499
|
+
* Command.withExamples([
|
|
52500
|
+
* { command: "myapp login", description: "Log in with browser OAuth" },
|
|
52501
|
+
* { command: "myapp login --token sbp_abc123", description: "Log in with a token" }
|
|
52502
|
+
* ])
|
|
52503
|
+
* )
|
|
52504
|
+
*
|
|
52505
|
+
* login.examples.map((example) => example.command) // => ["myapp login", "myapp login --token sbp_abc123"]
|
|
52506
|
+
* ```
|
|
52507
|
+
*
|
|
52508
|
+
* @stability unstable
|
|
52509
|
+
* @category combinators
|
|
52510
|
+
* @since 4.0.0
|
|
52511
|
+
*/
|
|
52512
|
+
const withExamples = /* @__PURE__ */ dual(2, (self, examples) => makeCommand({
|
|
52513
|
+
...toImpl(self),
|
|
52514
|
+
examples
|
|
52515
|
+
}));
|
|
52484
52516
|
const getOutOfScopeGlobalFlagErrors = (allFlags, activeFlags, flagMap, commandPath) => {
|
|
52485
52517
|
const activeSet = new Set(activeFlags);
|
|
52486
52518
|
const errors = [];
|
|
@@ -52737,7 +52769,7 @@ const runWith = (command, config) => {
|
|
|
52737
52769
|
//#endregion
|
|
52738
52770
|
//#region package.json
|
|
52739
52771
|
var name = "@effect/tsgo";
|
|
52740
|
-
var version = "0.
|
|
52772
|
+
var version = "0.59.0";
|
|
52741
52773
|
|
|
52742
52774
|
//#endregion
|
|
52743
52775
|
//#region src/metadata.json
|
|
@@ -55390,10 +55422,11 @@ var tags = {
|
|
|
55390
55422
|
"typescript": {
|
|
55391
55423
|
"latest": "7.0.2",
|
|
55392
55424
|
"beta": "7.1.0-beta",
|
|
55393
|
-
"next": "7.1.0-dev.
|
|
55425
|
+
"next": "7.1.0-dev.20261026.1"
|
|
55394
55426
|
},
|
|
55395
55427
|
"oxlint": { "latest": "1.89.0" },
|
|
55396
|
-
"oxlint-tsgolint": { "latest": "7.0.2005" }
|
|
55428
|
+
"oxlint-tsgolint": { "latest": "7.0.2005" },
|
|
55429
|
+
"tsrs": { "latest": "0.20.0-ts7.1.0-beta" }
|
|
55397
55430
|
};
|
|
55398
55431
|
var components = {
|
|
55399
55432
|
"typescript": {
|
|
@@ -55403,11 +55436,10 @@ var components = {
|
|
|
55403
55436
|
},
|
|
55404
55437
|
"7.1.0-beta": {
|
|
55405
55438
|
"gitHead": "3e9236361fa97a9e6c685f4833ac457ae2d8c50a",
|
|
55406
|
-
"provider": "typescript"
|
|
55407
|
-
"shims": "typescript-beta"
|
|
55439
|
+
"provider": "typescript"
|
|
55408
55440
|
},
|
|
55409
|
-
"7.1.0-dev.
|
|
55410
|
-
"gitHead": "
|
|
55441
|
+
"7.1.0-dev.20261026.1": {
|
|
55442
|
+
"gitHead": "8a62bbe746909624b69b6e671026b454da2f02cf",
|
|
55411
55443
|
"provider": "typescript"
|
|
55412
55444
|
}
|
|
55413
55445
|
},
|
|
@@ -55425,7 +55457,14 @@ var components = {
|
|
|
55425
55457
|
"1.87.0": { "gitHead": "2bd08ebe8f36fcf1954a675ffdeb4c6d0129f609" },
|
|
55426
55458
|
"1.88.0": { "gitHead": "6941b4ed45ead21c45bc2164cb80a180eed85b43" },
|
|
55427
55459
|
"1.89.0": { "gitHead": "07ed78f4abde4020ca7919381ffea4da8616b78a" }
|
|
55428
|
-
}
|
|
55460
|
+
},
|
|
55461
|
+
"tsrs": { "0.20.0-ts7.1.0-beta": {
|
|
55462
|
+
"gitHead": "d197eeea709616d61930c2bd5eac048471e404b8",
|
|
55463
|
+
"typescript": {
|
|
55464
|
+
"version": "7.1.0-beta",
|
|
55465
|
+
"gitHead": "3e9236361fa97a9e6c685f4833ac457ae2d8c50a"
|
|
55466
|
+
}
|
|
55467
|
+
} }
|
|
55429
55468
|
};
|
|
55430
55469
|
|
|
55431
55470
|
//#endregion
|
|
@@ -55463,13 +55502,16 @@ const readPackage = (require, packageName) => gen(function* () {
|
|
|
55463
55502
|
catch: () => new DiscoveryError({ reason: `Unable to parse ${packageJsonPath}.` })
|
|
55464
55503
|
});
|
|
55465
55504
|
if (typeof json !== "object" || json === null || !("version" in json) || typeof json.version !== "string") return yield* new DiscoveryError({ reason: `${packageJsonPath} does not contain a version.` });
|
|
55505
|
+
const bin = "bin" in json ? json.bin : void 0;
|
|
55466
55506
|
return {
|
|
55467
55507
|
packageJsonPath,
|
|
55468
55508
|
version: json.version,
|
|
55469
|
-
..."main" in json && typeof json.main === "string" ? { main: json.main } : {}
|
|
55509
|
+
..."main" in json && typeof json.main === "string" ? { main: json.main } : {},
|
|
55510
|
+
...typeof bin === "string" || typeof bin === "object" && bin !== null ? { bin } : {}
|
|
55470
55511
|
};
|
|
55471
55512
|
});
|
|
55472
55513
|
const optionally = (effect) => effect.pipe(catchTag("DiscoveryError", (error) => error.reason.startsWith("Unable to resolve ") ? succeed$2(void 0) : fail$2(error)));
|
|
55514
|
+
const findInstalledPackage = (require, packageName) => optionally(readPackage(require, packageName));
|
|
55473
55515
|
const isGlibc = () => {
|
|
55474
55516
|
if (process.platform !== "linux") return false;
|
|
55475
55517
|
return typeof ((process.report?.getReport())?.header)?.glibcVersionRuntime === "string";
|
|
@@ -55479,13 +55521,26 @@ const experimentalOxlintTarget = (platform, arch, glibc) => {
|
|
|
55479
55521
|
if (platform !== "linux" && platform !== "darwin" && platform !== "win32") throw new DiscoveryError({ reason: `Unsupported platform ${platform}.` });
|
|
55480
55522
|
const packageTarget = `${platform}-${arch}`;
|
|
55481
55523
|
const codeTarget = platform === "linux" ? `${packageTarget}-${glibc ? "gnu" : "musl"}` : packageTarget;
|
|
55524
|
+
const oxlintTarget = platform === "win32" ? `${codeTarget}-msvc` : codeTarget;
|
|
55482
55525
|
return {
|
|
55483
55526
|
codeTarget,
|
|
55484
|
-
|
|
55527
|
+
oxlintBinding: `oxlint.${oxlintTarget}.node`,
|
|
55528
|
+
oxlintPackage: `@oxlint/binding-${oxlintTarget}`,
|
|
55485
55529
|
tsgolintPackage: `@oxlint-tsgolint/${packageTarget}`,
|
|
55486
55530
|
tsgolintExecutable: platform === "win32" ? "tsgolint.exe" : "tsgolint"
|
|
55487
55531
|
};
|
|
55488
55532
|
};
|
|
55533
|
+
const tsrsTargets = [
|
|
55534
|
+
"darwin-arm64",
|
|
55535
|
+
"linux-x64-gnu",
|
|
55536
|
+
"linux-x64-musl",
|
|
55537
|
+
"linux-arm64-gnu",
|
|
55538
|
+
"linux-arm64-musl"
|
|
55539
|
+
];
|
|
55540
|
+
const tsrsTarget = (platform, arch, glibc) => {
|
|
55541
|
+
const target = platform === "linux" ? `${platform}-${arch}-${glibc ? "gnu" : "musl"}` : `${platform}-${arch}`;
|
|
55542
|
+
return tsrsTargets.includes(target) ? target : void 0;
|
|
55543
|
+
};
|
|
55489
55544
|
const discoverTypeScript = (cwdRequire, preferredPackage) => gen(function* () {
|
|
55490
55545
|
const path = yield* Path$2;
|
|
55491
55546
|
const packageNames = preferredPackage === void 0 || preferredPackage === "" ? defaultTypescriptPackageNames$1 : Array.from(new Set([preferredPackage, ...defaultTypescriptPackageNames$1]));
|
|
@@ -55541,6 +55596,22 @@ const discoverOxlint = (cwdRequire) => gen(function* () {
|
|
|
55541
55596
|
}
|
|
55542
55597
|
return discovered;
|
|
55543
55598
|
});
|
|
55599
|
+
const discoverTsrs = (cwdRequire) => gen(function* () {
|
|
55600
|
+
const path = yield* Path$2;
|
|
55601
|
+
const tsrs = yield* optionally(readPackage(cwdRequire, "tsrs"));
|
|
55602
|
+
if (tsrs === void 0) return [];
|
|
55603
|
+
const target = tsrsTarget(process.platform, process.arch, isGlibc());
|
|
55604
|
+
if (target === void 0) return [];
|
|
55605
|
+
const platformPackageName = `@tsrs/${target}`;
|
|
55606
|
+
const platformPackage = yield* optionally(readPackage(node_module.createRequire(tsrs.packageJsonPath), platformPackageName));
|
|
55607
|
+
if (platformPackage === void 0) return [];
|
|
55608
|
+
return [{
|
|
55609
|
+
component: "tsrs",
|
|
55610
|
+
packageName: platformPackageName,
|
|
55611
|
+
packageVersion: platformPackage.version,
|
|
55612
|
+
binaryPath: path.join(path.dirname(platformPackage.packageJsonPath), "tsrs")
|
|
55613
|
+
}];
|
|
55614
|
+
});
|
|
55544
55615
|
const discoverVitePlusOxlint = (cwdRequire) => gen(function* () {
|
|
55545
55616
|
const vitePlus = yield* optionally(readPackage(cwdRequire, "vite-plus"));
|
|
55546
55617
|
if (vitePlus === void 0) return [];
|
|
@@ -55552,10 +55623,12 @@ const discoverBinaries = (cwd, preferredTypescriptPackage) => gen(function* () {
|
|
|
55552
55623
|
const typescript = yield* discoverTypeScript(cwdRequire, preferredTypescriptPackage);
|
|
55553
55624
|
const oxlint = yield* discoverOxlint(cwdRequire);
|
|
55554
55625
|
const vitePlusOxlint = yield* discoverVitePlusOxlint(cwdRequire);
|
|
55626
|
+
const tsrs = yield* discoverTsrs(cwdRequire);
|
|
55555
55627
|
const discovered = [...new Map([
|
|
55556
55628
|
...typescript,
|
|
55557
55629
|
...oxlint,
|
|
55558
|
-
...vitePlusOxlint
|
|
55630
|
+
...vitePlusOxlint,
|
|
55631
|
+
...tsrs
|
|
55559
55632
|
].map((binary) => [binary.binaryPath, binary])).values()];
|
|
55560
55633
|
return yield* forEach$1(discovered, (binary) => hashFile(binary.binaryPath).pipe(map$5((fileHash) => ({
|
|
55561
55634
|
...binary,
|
|
@@ -55564,7 +55637,7 @@ const discoverBinaries = (cwd, preferredTypescriptPackage) => gen(function* () {
|
|
|
55564
55637
|
});
|
|
55565
55638
|
const selectComponents = (binaries, components) => binaries.filter((binary) => components.has(binary.component));
|
|
55566
55639
|
const requireComponents = (binaries, components) => gen(function* () {
|
|
55567
|
-
for (const component of components) if (!binaries.some((binary) => binary.component === component)) return yield* new DiscoveryError({ reason: `Unable to discover an installed ${component} binary.` });
|
|
55640
|
+
for (const component of components) if (!binaries.some((binary) => binary.component === component)) return yield* new DiscoveryError({ reason: component === "tsrs" ? `Unable to discover an installed tsrs binary. Install the tsrs package; its binary is published for ${tsrsTargets.join(", ")}.` : `Unable to discover an installed ${component} binary.` });
|
|
55568
55641
|
return binaries;
|
|
55569
55642
|
});
|
|
55570
55643
|
|
|
@@ -55631,29 +55704,39 @@ const resolveOxlintDeclarations = (target) => gen(function* () {
|
|
|
55631
55704
|
fileHash: yield* hashBytes(replacement).pipe(mapError((error) => new PatcherError({ reason: `Unable to hash generated Oxlint declarations: ${error.message}` })))
|
|
55632
55705
|
};
|
|
55633
55706
|
});
|
|
55634
|
-
const
|
|
55707
|
+
const resolvePlatformPackageDirectory = gen(function* () {
|
|
55635
55708
|
const path = yield* Path$2;
|
|
55636
55709
|
const packageName = `@effect/tsgo-${process.platform}-${process.arch}`;
|
|
55637
55710
|
const selfRequire = node_module.createRequire(require("url").pathToFileURL(__filename).href);
|
|
55638
55711
|
const packageJsonPath = yield* try_({
|
|
55639
55712
|
try: () => selfRequire.resolve(`${packageName}/package.json`),
|
|
55640
|
-
catch: () => new
|
|
55641
|
-
target,
|
|
55642
|
-
reason: `Unable to resolve ${packageName}; no packaged replacement is available.`
|
|
55643
|
-
})
|
|
55713
|
+
catch: () => new PatcherError({ reason: `Unable to resolve ${packageName}; no packaged replacement is available.` })
|
|
55644
55714
|
});
|
|
55645
|
-
return
|
|
55715
|
+
return path.dirname(packageJsonPath);
|
|
55716
|
+
});
|
|
55717
|
+
const resolvePlatformPackage = (target) => resolvePlatformPackageDirectory.pipe(map$5((packageDir) => ({ packageDir })), mapError(({ reason }) => new ReplacementUnavailableError({
|
|
55718
|
+
target,
|
|
55719
|
+
reason
|
|
55720
|
+
})));
|
|
55721
|
+
const tsrsReplacementTargets = [
|
|
55722
|
+
"darwin-arm64",
|
|
55723
|
+
"linux-x64-gnu",
|
|
55724
|
+
"linux-arm64-gnu"
|
|
55725
|
+
];
|
|
55726
|
+
const packagedComponentPath = (packageDir, component, version, fileName) => gen(function* () {
|
|
55727
|
+
const path = yield* Path$2;
|
|
55728
|
+
return component === "typescript" && version === tags.typescript.latest ? path.join(packageDir, "lib", fileName) : path.join(packageDir, "artifacts", component, version, fileName);
|
|
55646
55729
|
});
|
|
55647
55730
|
const packagedArtifactPath = (packageDir, target) => gen(function* () {
|
|
55648
55731
|
const path = yield* Path$2;
|
|
55649
55732
|
const fileName = path.basename(target.binaryPath);
|
|
55650
|
-
return target.component === "
|
|
55733
|
+
return target.component === "oxlint-dts" ? path.join(packageDir, "artifacts", target.component, target.packageVersion, fileName) : yield* packagedComponentPath(packageDir, target.component, target.packageVersion, fileName);
|
|
55651
55734
|
});
|
|
55652
55735
|
const resolveReplacement = (target) => gen(function* () {
|
|
55653
55736
|
const fs = yield* FileSystem;
|
|
55654
55737
|
if (target.component !== "typescript" && process.platform === "linux" && !isGlibc()) return yield* new ReplacementUnavailableError({
|
|
55655
55738
|
target,
|
|
55656
|
-
reason: "Linux musl is not supported by the packaged Oxlint integration."
|
|
55739
|
+
reason: target.component === "tsrs" ? `Linux musl is not supported by the packaged tsrs integration; it is built for ${tsrsReplacementTargets.join(", ")}.` : "Linux musl is not supported by the packaged Oxlint integration."
|
|
55657
55740
|
});
|
|
55658
55741
|
if (target.component === "oxlint-dts") return yield* resolveOxlintDeclarations(target);
|
|
55659
55742
|
const replacementPath = yield* packagedArtifactPath((yield* resolvePlatformPackage(target)).packageDir, target);
|
|
@@ -204818,9 +204901,276 @@ var IntegrationSelectionError = class extends TaggedError$1("IntegrationSelectio
|
|
|
204818
204901
|
};
|
|
204819
204902
|
const integrationFlags = {
|
|
204820
204903
|
typescript: Boolean$1("typescript").pipe(withDefault(true), withDescription$1("Include the native TypeScript-Go integration")),
|
|
204821
|
-
oxlint: Boolean$1("oxlint").pipe(withDefault(false), withDescription$1("Include the experimental Oxlint integration"))
|
|
204904
|
+
oxlint: Boolean$1("oxlint").pipe(withDefault(false), withDescription$1("Include the experimental Oxlint integration")),
|
|
204905
|
+
tsrs: Boolean$1("tsrs").pipe(withDefault(false), withDescription$1("Include the experimental tsrs integration (the installed tsrs package's binary)"))
|
|
204906
|
+
};
|
|
204907
|
+
const ensureIntegrationSelected = (typescript, oxlint, tsrs = false) => typescript || oxlint || tsrs ? void_$1 : fail$2(new IntegrationSelectionError({ reason: "Select at least one integration to manage." }));
|
|
204908
|
+
|
|
204909
|
+
//#endregion
|
|
204910
|
+
//#region src/cli/proxy/exec.ts
|
|
204911
|
+
const nodeExecHost = {
|
|
204912
|
+
platform: process.platform,
|
|
204913
|
+
execve: typeof process.execve === "function" ? (file, args, env) => process.execve(file, args, env) : void 0,
|
|
204914
|
+
spawn: (file, args, options) => node_child_process.spawn(file, args, options),
|
|
204915
|
+
parent: process,
|
|
204916
|
+
reportError: (message) => process.stderr.write(`${message}\n`)
|
|
204917
|
+
};
|
|
204918
|
+
const forwardedSignals = (platform) => platform === "win32" ? [
|
|
204919
|
+
"SIGINT",
|
|
204920
|
+
"SIGTERM",
|
|
204921
|
+
"SIGHUP",
|
|
204922
|
+
"SIGBREAK"
|
|
204923
|
+
] : [
|
|
204924
|
+
"SIGINT",
|
|
204925
|
+
"SIGTERM",
|
|
204926
|
+
"SIGHUP",
|
|
204927
|
+
"SIGQUIT"
|
|
204928
|
+
];
|
|
204929
|
+
const execProxyCommand = (command, host = nodeExecHost) => {
|
|
204930
|
+
if (host.platform !== "win32" && host.execve !== void 0) try {
|
|
204931
|
+
host.execve(command.file, [command.file, ...command.args], command.env);
|
|
204932
|
+
} catch {}
|
|
204933
|
+
const signals = forwardedSignals(host.platform);
|
|
204934
|
+
const listening = [];
|
|
204935
|
+
let settled = false;
|
|
204936
|
+
let child;
|
|
204937
|
+
const forward = (signal) => {
|
|
204938
|
+
try {
|
|
204939
|
+
child?.kill(signal);
|
|
204940
|
+
} catch {}
|
|
204941
|
+
};
|
|
204942
|
+
const settle = (onSettled) => {
|
|
204943
|
+
if (settled) return;
|
|
204944
|
+
settled = true;
|
|
204945
|
+
for (const signal of listening) host.parent.off(signal, forward);
|
|
204946
|
+
onSettled();
|
|
204947
|
+
};
|
|
204948
|
+
const fail = (error) => settle(() => {
|
|
204949
|
+
host.reportError(`Failed to run ${command.file}: ${error instanceof Error ? error.message : String(error)}`);
|
|
204950
|
+
host.parent.exitCode = 1;
|
|
204951
|
+
});
|
|
204952
|
+
try {
|
|
204953
|
+
child = host.spawn(command.file, command.args, {
|
|
204954
|
+
stdio: "inherit",
|
|
204955
|
+
env: command.env
|
|
204956
|
+
});
|
|
204957
|
+
} catch (error) {
|
|
204958
|
+
fail(error);
|
|
204959
|
+
return;
|
|
204960
|
+
}
|
|
204961
|
+
child.on("error", fail);
|
|
204962
|
+
child.on("exit", (status, signal) => settle(() => propagateDiagnosticsExit({
|
|
204963
|
+
status,
|
|
204964
|
+
signal
|
|
204965
|
+
}, host.parent)));
|
|
204966
|
+
for (const signal of signals) {
|
|
204967
|
+
if (settled) break;
|
|
204968
|
+
try {
|
|
204969
|
+
host.parent.on(signal, forward);
|
|
204970
|
+
listening.push(signal);
|
|
204971
|
+
} catch {}
|
|
204972
|
+
}
|
|
204973
|
+
};
|
|
204974
|
+
|
|
204975
|
+
//#endregion
|
|
204976
|
+
//#region src/cli/proxy/resolve.ts
|
|
204977
|
+
var ProxyError = class extends TaggedError$1("ProxyError") {
|
|
204978
|
+
get message() {
|
|
204979
|
+
return this.reason;
|
|
204980
|
+
}
|
|
204981
|
+
};
|
|
204982
|
+
var UnsupportedProxyVersionError = class extends TaggedError$1("UnsupportedProxyVersionError") {
|
|
204983
|
+
get message() {
|
|
204984
|
+
const tags = Object.entries(this.tags).map(([tag, version]) => `${tag} (${version})`);
|
|
204985
|
+
return this.source === "requested" ? `${this.packageName}@${this.version} is not supported by @effect/tsgo version ${version}. Supported versions: ${this.supportedVersions.join(", ")}` + (tags.length === 0 ? "." : `; tags: ${tags.join(", ")}.`) : `Installed ${this.packageName} version ${this.version} is not supported by @effect/tsgo version ${version}. Either change @effect/tsgo to a compatible version or set ${this.packageName} to one of the supported versions: ${this.supportedVersions.join(", ")}.`;
|
|
204986
|
+
}
|
|
204987
|
+
};
|
|
204988
|
+
const upstreamTags = (component) => tags[component];
|
|
204989
|
+
const selectVersion = (tool, component, requested, installed) => gen(function* () {
|
|
204990
|
+
const versions = supportedVersions(component);
|
|
204991
|
+
const tags = upstreamTags(component);
|
|
204992
|
+
if (requested !== void 0) {
|
|
204993
|
+
if (requested === "") return yield* new ProxyError({ reason: `Expected a version or tag after ${tool}@.` });
|
|
204994
|
+
const version = Object.hasOwn(tags, requested) ? tags[requested] : requested;
|
|
204995
|
+
if (versions.includes(version)) return version;
|
|
204996
|
+
return yield* new UnsupportedProxyVersionError({
|
|
204997
|
+
packageName: tool,
|
|
204998
|
+
version: requested,
|
|
204999
|
+
source: "requested",
|
|
205000
|
+
supportedVersions: versions,
|
|
205001
|
+
tags
|
|
205002
|
+
});
|
|
205003
|
+
}
|
|
205004
|
+
if (installed !== void 0 && versions.includes(installed)) return installed;
|
|
205005
|
+
return tags.latest;
|
|
205006
|
+
});
|
|
205007
|
+
const projectRequire = (context) => gen(function* () {
|
|
205008
|
+
const path = yield* Path$2;
|
|
205009
|
+
return node_module.createRequire(path.join(context.cwd, "noop.js"));
|
|
205010
|
+
});
|
|
205011
|
+
const toProxyError = (error) => new ProxyError({ reason: error.message });
|
|
205012
|
+
const installedTypescriptVersion = (context) => gen(function* () {
|
|
205013
|
+
const require = yield* projectRequire(context);
|
|
205014
|
+
for (const packageName of defaultTypescriptPackageNames$1) {
|
|
205015
|
+
const installed = yield* findInstalledPackage(require, packageName).pipe(mapError(toProxyError));
|
|
205016
|
+
if (installed !== void 0 && isNativeTypescriptVersion$1(installed.version)) return installed.version;
|
|
205017
|
+
}
|
|
205018
|
+
});
|
|
205019
|
+
const installedTsrsVersion = (context) => gen(function* () {
|
|
205020
|
+
return (yield* findInstalledPackage(yield* projectRequire(context), "tsrs").pipe(mapError(toProxyError)))?.version;
|
|
205021
|
+
});
|
|
205022
|
+
const requireArtifact = (artifactPath) => gen(function* () {
|
|
205023
|
+
if (!(yield* (yield* FileSystem).exists(artifactPath).pipe(mapError(toProxyError)))) return yield* new ProxyError({ reason: `Missing packaged artifact ${artifactPath}.` });
|
|
205024
|
+
return artifactPath;
|
|
205025
|
+
});
|
|
205026
|
+
const ensureExecutable = (filePath, platform) => gen(function* () {
|
|
205027
|
+
if (platform === "win32") return;
|
|
205028
|
+
const fs = yield* FileSystem;
|
|
205029
|
+
if (yield* promise(() => (0, node_fs_promises.access)(filePath, node_fs.constants.X_OK).then(() => true, () => false))) return;
|
|
205030
|
+
yield* fs.chmod(filePath, 493).pipe(mapError((error) => new ProxyError({ reason: `Failed to set executable permissions on ${filePath}: ${error.message}` })));
|
|
205031
|
+
});
|
|
205032
|
+
const executablePath = (filePath, platform) => platform === "win32" && filePath.length >= 248 ? node_path.win32.toNamespacedPath(filePath) : filePath;
|
|
205033
|
+
const tscExecutable = (context, version) => packagedComponentPath(context.packageDirectory, "typescript", version, context.platform === "win32" ? "tsc.exe" : "tsc");
|
|
205034
|
+
const tsrsExecutable = (context, version) => packagedComponentPath(context.packageDirectory, "tsrs", version, "tsrs");
|
|
205035
|
+
const resolveTsc = (context, invocation) => gen(function* () {
|
|
205036
|
+
const installed = invocation.version === void 0 ? yield* installedTypescriptVersion(context) : void 0;
|
|
205037
|
+
const executable = yield* requireArtifact(yield* tscExecutable(context, yield* selectVersion("tsc", "typescript", invocation.version, installed)));
|
|
205038
|
+
yield* ensureExecutable(executable, context.platform);
|
|
205039
|
+
return {
|
|
205040
|
+
file: executablePath(executable, context.platform),
|
|
205041
|
+
args: invocation.args,
|
|
205042
|
+
env: context.env
|
|
205043
|
+
};
|
|
205044
|
+
});
|
|
205045
|
+
const resolveTsrs = (context, invocation) => gen(function* () {
|
|
205046
|
+
const fs = yield* FileSystem;
|
|
205047
|
+
const path = yield* Path$2;
|
|
205048
|
+
if (context.platform === "linux" && !context.isGlibc()) return yield* new ProxyError({ reason: `Linux musl is not supported by the packaged tsrs integration; it is built for ${tsrsReplacementTargets.join(", ")}.` });
|
|
205049
|
+
const target = tsrsTarget(context.platform, context.arch, true);
|
|
205050
|
+
if (target === void 0 || !tsrsReplacementTargets.includes(target)) return yield* new ProxyError({ reason: `The packaged tsrs integration is not available for ${context.platform}-${context.arch}; it is built for ${tsrsReplacementTargets.join(", ")}.` });
|
|
205051
|
+
const installed = invocation.version === void 0 ? yield* installedTsrsVersion(context) : void 0;
|
|
205052
|
+
const executable = yield* requireArtifact(yield* tsrsExecutable(context, yield* selectVersion("tsrs", "tsrs", invocation.version, installed)));
|
|
205053
|
+
const libraryPath = path.join(path.dirname(executable), "lib.d.ts");
|
|
205054
|
+
if (!(yield* fs.exists(libraryPath).pipe(mapError(toProxyError)))) return yield* new ProxyError({ reason: `Missing ${libraryPath}: tsrs needs its lib*.d.ts files next to the packaged binary ${executable}. Reinstall @effect/tsgo-${context.platform}-${context.arch}.` });
|
|
205055
|
+
yield* ensureExecutable(executable, context.platform);
|
|
205056
|
+
return {
|
|
205057
|
+
file: executable,
|
|
205058
|
+
args: invocation.args,
|
|
205059
|
+
env: context.env
|
|
205060
|
+
};
|
|
205061
|
+
});
|
|
205062
|
+
const findOxlintInstallation = (cwd) => gen(function* () {
|
|
205063
|
+
const path = yield* Path$2;
|
|
205064
|
+
const find = (require, packageName) => findInstalledPackage(require, packageName).pipe(mapError(toProxyError));
|
|
205065
|
+
const cwdRequire = node_module.createRequire(path.join(cwd, "noop.js"));
|
|
205066
|
+
const vitePlus = yield* find(cwdRequire, "vite-plus");
|
|
205067
|
+
const scopes = [cwdRequire, ...vitePlus === void 0 ? [] : [node_module.createRequire(vitePlus.packageJsonPath)]];
|
|
205068
|
+
for (const require of scopes) {
|
|
205069
|
+
const oxlint = yield* find(require, "oxlint");
|
|
205070
|
+
if (oxlint !== void 0) return {
|
|
205071
|
+
oxlint,
|
|
205072
|
+
tsgolint: yield* find(require, "oxlint-tsgolint")
|
|
205073
|
+
};
|
|
205074
|
+
}
|
|
205075
|
+
});
|
|
205076
|
+
const oxlintBinPath = (oxlint) => gen(function* () {
|
|
205077
|
+
const path = yield* Path$2;
|
|
205078
|
+
const bin = typeof oxlint.bin === "string" ? oxlint.bin : oxlint.bin?.oxlint;
|
|
205079
|
+
if (bin === void 0) return yield* new ProxyError({ reason: `${oxlint.packageJsonPath} does not declare an oxlint bin entry.` });
|
|
205080
|
+
return path.resolve(path.dirname(oxlint.packageJsonPath), bin);
|
|
205081
|
+
});
|
|
205082
|
+
const supportedInstalledVersion = (component, installed) => {
|
|
205083
|
+
const versions = supportedVersions(component);
|
|
205084
|
+
return versions.includes(installed.version) ? succeed$2(installed.version) : fail$2(new UnsupportedProxyVersionError({
|
|
205085
|
+
packageName: component,
|
|
205086
|
+
version: installed.version,
|
|
205087
|
+
source: "installed",
|
|
205088
|
+
supportedVersions: versions,
|
|
205089
|
+
tags: {}
|
|
205090
|
+
}));
|
|
205091
|
+
};
|
|
205092
|
+
const oxlintCommand = (context, args, installation) => gen(function* () {
|
|
205093
|
+
const target = yield* try_({
|
|
205094
|
+
try: () => experimentalOxlintTarget(context.platform, context.arch, context.platform === "linux" && context.isGlibc()),
|
|
205095
|
+
catch: (error) => new ProxyError({ reason: error instanceof Error ? error.message : String(error) })
|
|
205096
|
+
});
|
|
205097
|
+
const oxlintVersion = yield* supportedInstalledVersion("oxlint", installation.oxlint);
|
|
205098
|
+
const binding = yield* requireArtifact(yield* packagedComponentPath(context.packageDirectory, "oxlint", oxlintVersion, target.oxlintBinding));
|
|
205099
|
+
let tsgolint;
|
|
205100
|
+
if (installation.tsgolint !== void 0) {
|
|
205101
|
+
const tsgolintVersion = yield* supportedInstalledVersion("oxlint-tsgolint", installation.tsgolint);
|
|
205102
|
+
tsgolint = yield* requireArtifact(yield* packagedComponentPath(context.packageDirectory, "oxlint-tsgolint", tsgolintVersion, target.tsgolintExecutable));
|
|
205103
|
+
yield* ensureExecutable(tsgolint, context.platform);
|
|
205104
|
+
}
|
|
205105
|
+
const bin = yield* oxlintBinPath(installation.oxlint);
|
|
205106
|
+
return {
|
|
205107
|
+
file: context.execPath,
|
|
205108
|
+
args: [bin, ...args],
|
|
205109
|
+
env: {
|
|
205110
|
+
...context.env,
|
|
205111
|
+
NAPI_RS_NATIVE_LIBRARY_PATH: binding,
|
|
205112
|
+
...tsgolint === void 0 ? {} : { OXLINT_TSGOLINT_PATH: tsgolint }
|
|
205113
|
+
}
|
|
205114
|
+
};
|
|
205115
|
+
});
|
|
205116
|
+
const resolveOxlint = (context, invocation) => gen(function* () {
|
|
205117
|
+
if (invocation.version !== void 0) return yield* new ProxyError({ reason: `oxlint@${invocation.version} is not supported: the packaged Oxlint build is selected by the installed oxlint version. Run effect-tsgo oxlint instead.` });
|
|
205118
|
+
if (context.platform === "linux" && !context.isGlibc()) return yield* new ProxyError({ reason: "Linux musl is not supported by the packaged Oxlint integration." });
|
|
205119
|
+
const installation = yield* findOxlintInstallation(context.cwd);
|
|
205120
|
+
if (installation === void 0) return yield* new ProxyError({ reason: `Unable to resolve oxlint from ${context.cwd}. Install oxlint (or vite-plus) in the project.` });
|
|
205121
|
+
return yield* oxlintCommand(context, invocation.args, installation);
|
|
205122
|
+
});
|
|
205123
|
+
const resolveProxyCommand = (invocation, context) => {
|
|
205124
|
+
switch (invocation.tool) {
|
|
205125
|
+
case "tsc": return resolveTsc(context, invocation);
|
|
205126
|
+
case "tsrs": return resolveTsrs(context, invocation);
|
|
205127
|
+
case "oxlint": return resolveOxlint(context, invocation);
|
|
205128
|
+
}
|
|
205129
|
+
};
|
|
205130
|
+
|
|
205131
|
+
//#endregion
|
|
205132
|
+
//#region src/cli/proxy/argv.ts
|
|
205133
|
+
const proxyTools = [
|
|
205134
|
+
"tsc",
|
|
205135
|
+
"tsrs",
|
|
205136
|
+
"oxlint"
|
|
205137
|
+
];
|
|
205138
|
+
const isProxyTool = (value) => proxyTools.includes(value);
|
|
205139
|
+
const parseProxyInvocation = (argv) => {
|
|
205140
|
+
const [first, ...args] = argv;
|
|
205141
|
+
if (first === void 0) return void 0;
|
|
205142
|
+
const separator = first.indexOf("@");
|
|
205143
|
+
const tool = separator === -1 ? first : first.slice(0, separator);
|
|
205144
|
+
if (!isProxyTool(tool)) return void 0;
|
|
205145
|
+
return {
|
|
205146
|
+
tool,
|
|
205147
|
+
version: separator === -1 ? void 0 : first.slice(separator + 1),
|
|
205148
|
+
args
|
|
205149
|
+
};
|
|
205150
|
+
};
|
|
205151
|
+
|
|
205152
|
+
//#endregion
|
|
205153
|
+
//#region src/cli/proxy/index.ts
|
|
205154
|
+
const runProxy = (invocation, host = nodeExecHost) => {
|
|
205155
|
+
const program = gen(function* () {
|
|
205156
|
+
const packageDirectory = yield* resolvePlatformPackageDirectory.pipe(mapError(({ reason }) => new ProxyError({ reason })));
|
|
205157
|
+
return yield* resolveProxyCommand(invocation, {
|
|
205158
|
+
cwd: process.cwd(),
|
|
205159
|
+
env: process.env,
|
|
205160
|
+
execPath: process.execPath,
|
|
205161
|
+
platform: process.platform,
|
|
205162
|
+
arch: process.arch,
|
|
205163
|
+
isGlibc,
|
|
205164
|
+
packageDirectory
|
|
205165
|
+
});
|
|
205166
|
+
}).pipe(provide(layer));
|
|
205167
|
+
return runPromiseExit(program).then((exit) => {
|
|
205168
|
+
if (isSuccess$1(exit)) return execProxyCommand(exit.value, host);
|
|
205169
|
+
const error = squash(exit.cause);
|
|
205170
|
+
host.reportError(`effect-tsgo ${invocation.tool}: ${error instanceof Error ? error.message : String(error)}`);
|
|
205171
|
+
host.parent.exitCode = 1;
|
|
205172
|
+
});
|
|
204822
205173
|
};
|
|
204823
|
-
const ensureIntegrationSelected = (typescript, oxlint) => typescript || oxlint ? void_$1 : fail$2(new IntegrationSelectionError({ reason: "Select at least one integration to manage." }));
|
|
204824
205174
|
|
|
204825
205175
|
//#endregion
|
|
204826
205176
|
//#region src/cli/presets.ts
|
|
@@ -205097,13 +205447,14 @@ var ChmodBinaryError = class extends TaggedError$1("ChmodBinaryError") {
|
|
|
205097
205447
|
return `Failed to set executable permissions on ${this.targetPath}.`;
|
|
205098
205448
|
}
|
|
205099
205449
|
};
|
|
205100
|
-
const selectedComponents = (typescript, oxlint) => {
|
|
205450
|
+
const selectedComponents = (typescript, oxlint, tsrs) => {
|
|
205101
205451
|
const components = /* @__PURE__ */ new Set();
|
|
205102
205452
|
if (typescript) components.add("typescript");
|
|
205103
205453
|
if (oxlint) {
|
|
205104
205454
|
components.add("oxlint");
|
|
205105
205455
|
components.add("oxlint-tsgolint");
|
|
205106
205456
|
}
|
|
205457
|
+
if (tsrs) components.add("tsrs");
|
|
205107
205458
|
return components;
|
|
205108
205459
|
};
|
|
205109
205460
|
const discoverSelected = (components, preferredTypescriptPackage) => gen(function* () {
|
|
@@ -205116,10 +205467,10 @@ const patchCommand = make("patch", {
|
|
|
205116
205467
|
force: Boolean$1("force").pipe(withDefault(false), withDescription$1("Deprecated compatibility flag; replacements are selected by package version")),
|
|
205117
205468
|
skipMissing: Boolean$1("skip-missing").pipe(withDefault(false), withDescription$1("Skip selected integrations without a matching packaged replacement")),
|
|
205118
205469
|
typescriptPackage: typescriptPackageFlag
|
|
205119
|
-
}).pipe(withDescription("Patch the selected Effect integrations"), withHandler(({ oxlint, skipMissing, typescript, typescriptPackage }) => scoped(gen(function* () {
|
|
205120
|
-
yield* ensureIntegrationSelected(typescript, oxlint);
|
|
205470
|
+
}).pipe(withDescription("Patch the selected Effect integrations"), withHandler(({ oxlint, skipMissing, tsrs, typescript, typescriptPackage }) => scoped(gen(function* () {
|
|
205471
|
+
yield* ensureIntegrationSelected(typescript, oxlint, tsrs);
|
|
205121
205472
|
if (!typescript && isSome(typescriptPackage)) return yield* new IntegrationSelectionError({ reason: "--typescript-package requires the TypeScript integration." });
|
|
205122
|
-
const components = selectedComponents(typescript, oxlint);
|
|
205473
|
+
const components = selectedComponents(typescript, oxlint, tsrs);
|
|
205123
205474
|
const result = yield* patch({
|
|
205124
205475
|
cwd: process.cwd(),
|
|
205125
205476
|
components,
|
|
@@ -205132,10 +205483,10 @@ const patchCommand = make("patch", {
|
|
|
205132
205483
|
const unpatchCommand = make("unpatch", {
|
|
205133
205484
|
...integrationFlags,
|
|
205134
205485
|
typescriptPackage: typescriptPackageFlag
|
|
205135
|
-
}).pipe(withDescription("Unpatch and restore the selected integrations"), withHandler(({ oxlint, typescript, typescriptPackage }) => gen(function* () {
|
|
205136
|
-
yield* ensureIntegrationSelected(typescript, oxlint);
|
|
205486
|
+
}).pipe(withDescription("Unpatch and restore the selected integrations"), withHandler(({ oxlint, tsrs, typescript, typescriptPackage }) => gen(function* () {
|
|
205487
|
+
yield* ensureIntegrationSelected(typescript, oxlint, tsrs);
|
|
205137
205488
|
if (!typescript && isSome(typescriptPackage)) return yield* new IntegrationSelectionError({ reason: "--typescript-package requires the TypeScript integration." });
|
|
205138
|
-
const components = selectedComponents(typescript, oxlint);
|
|
205489
|
+
const components = selectedComponents(typescript, oxlint, tsrs);
|
|
205139
205490
|
const result = yield* unpatch({
|
|
205140
205491
|
cwd: process.cwd(),
|
|
205141
205492
|
components,
|
|
@@ -205183,13 +205534,37 @@ const diagnosticsCommand = make("diagnostics", {
|
|
|
205183
205534
|
listFiles
|
|
205184
205535
|
}));
|
|
205185
205536
|
})));
|
|
205186
|
-
make("tsgo").pipe(
|
|
205537
|
+
const rootCommand = make("tsgo").pipe(withDescription("Effect Language Service for TypeScript-Go. Besides the commands below, `effect-tsgo tsc[@<version|tag>] [args...]`, `effect-tsgo tsrs[@<version|tag>] [args...]` and `effect-tsgo oxlint [args...]` run the Effect-patched tsc, tsrs and Oxlint straight from @effect/tsgo without patching node_modules, passing every argument after the tool through unchanged. Without a version, tsc and tsrs use the installed version when supported, else the latest supported one; oxlint uses the build of the installed oxlint."), withExamples([
|
|
205538
|
+
{
|
|
205539
|
+
command: "effect-tsgo tsc -p tsconfig.json",
|
|
205540
|
+
description: "Type check with the Effect-patched tsc"
|
|
205541
|
+
},
|
|
205542
|
+
{
|
|
205543
|
+
command: "effect-tsgo tsc@7.0.2 --lsp --stdio",
|
|
205544
|
+
description: "Start the language server of a given TypeScript version"
|
|
205545
|
+
},
|
|
205546
|
+
{
|
|
205547
|
+
command: "effect-tsgo tsc@next --build",
|
|
205548
|
+
description: "Use the version behind an upstream tag (latest, beta, next)"
|
|
205549
|
+
},
|
|
205550
|
+
{
|
|
205551
|
+
command: "effect-tsgo tsrs --noEmit",
|
|
205552
|
+
description: "Type check with the Effect-patched tsrs"
|
|
205553
|
+
},
|
|
205554
|
+
{
|
|
205555
|
+
command: "effect-tsgo oxlint --type-aware",
|
|
205556
|
+
description: "Lint with the Effect-patched Oxlint and tsgolint"
|
|
205557
|
+
}
|
|
205558
|
+
]), withSubcommands([
|
|
205187
205559
|
patchCommand,
|
|
205188
205560
|
unpatchCommand,
|
|
205189
205561
|
getExePathCommand,
|
|
205190
205562
|
diagnosticsCommand,
|
|
205191
205563
|
setupCommand,
|
|
205192
205564
|
configCommand
|
|
205193
|
-
]))
|
|
205565
|
+
]));
|
|
205566
|
+
const proxyInvocation = parseProxyInvocation(process.argv.slice(2));
|
|
205567
|
+
if (proxyInvocation !== void 0) runProxy(proxyInvocation);
|
|
205568
|
+
else rootCommand.pipe(run({ version }), provide(layer), runMain());
|
|
205194
205569
|
|
|
205195
205570
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect/tsgo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.59.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Effect Language Service for TypeScript-Go — Effect-specific diagnostics and hover features.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -41,13 +41,13 @@
|
|
|
41
41
|
"schema.json"
|
|
42
42
|
],
|
|
43
43
|
"optionalDependencies": {
|
|
44
|
-
"@effect/tsgo-win32-x64": "0.
|
|
45
|
-
"@effect/tsgo-win32-arm64": "0.
|
|
46
|
-
"@effect/tsgo-linux-x64": "0.
|
|
47
|
-
"@effect/tsgo-linux-arm64": "0.
|
|
48
|
-
"@effect/tsgo-linux-arm": "0.
|
|
49
|
-
"@effect/tsgo-darwin-x64": "0.
|
|
50
|
-
"@effect/tsgo-darwin-arm64": "0.
|
|
44
|
+
"@effect/tsgo-win32-x64": "0.59.0",
|
|
45
|
+
"@effect/tsgo-win32-arm64": "0.59.0",
|
|
46
|
+
"@effect/tsgo-linux-x64": "0.59.0",
|
|
47
|
+
"@effect/tsgo-linux-arm64": "0.59.0",
|
|
48
|
+
"@effect/tsgo-linux-arm": "0.59.0",
|
|
49
|
+
"@effect/tsgo-darwin-x64": "0.59.0",
|
|
50
|
+
"@effect/tsgo-darwin-arm64": "0.59.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@effect/platform-node": "^4.0.2",
|
package/schema.json
CHANGED
|
@@ -567,6 +567,20 @@
|
|
|
567
567
|
"markdownDescription": "Enables [experimental support for decorators](https://github.com/tc39/proposal-decorators), which is a version of decorators that predates the TC39 standardization process.\n\nDecorators are a language feature which hasn't yet been fully ratified into the JavaScript specification.\nThis means that the implementation version in TypeScript may differ from the implementation in JavaScript when it is decided by TC39.\n\nYou can find out more about decorator support in TypeScript in [the handbook](https://typescriptlang.org/docs/handbook/decorators.html).",
|
|
568
568
|
"x-intellij-html-description": "\u003cp\u003eEnables \u003ca href=\"https://github.com/tc39/proposal-decorators\"\u003eexperimental support for decorators\u003c/a\u003e, which is a version of decorators that predates the TC39 standardization process.\u003c/p\u003e\n\u003cp\u003eDecorators are a language feature which hasn\u0026#39;t yet been fully ratified into the JavaScript specification.\nThis means that the implementation version in TypeScript may differ from the implementation in JavaScript when it is decided by TC39.\u003c/p\u003e\n\u003cp\u003eYou can find out more about decorator support in TypeScript in \u003ca href=\"https://typescriptlang.org/docs/handbook/decorators.html\"\u003ethe handbook\u003c/a\u003e.\u003c/p\u003e\n"
|
|
569
569
|
},
|
|
570
|
+
"explainFiles": {
|
|
571
|
+
"anyOf": [
|
|
572
|
+
{
|
|
573
|
+
"type": "boolean"
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
"type": "null"
|
|
577
|
+
}
|
|
578
|
+
],
|
|
579
|
+
"default": false,
|
|
580
|
+
"description": "Print files read during the compilation including why it was included.",
|
|
581
|
+
"markdownDescription": "Print files read during the compilation including why it was included.",
|
|
582
|
+
"x-intellij-html-description": "\u003cp\u003ePrint files read during the compilation including why it was included.\u003c/p\u003e\n"
|
|
583
|
+
},
|
|
570
584
|
"extendedDiagnostics": {
|
|
571
585
|
"anyOf": [
|
|
572
586
|
{
|
|
@@ -621,6 +635,19 @@
|
|
|
621
635
|
"markdownDescription": "This option gives you the chance to have TypeScript emit a v8 CPU profile during the compiler run. The CPU profile can provide insight into why your builds may be slow.\n\nThis option can only be used from the CLI via: `--generateCpuProfile tsc-output.cpuprofile`.\n\n```sh\nnpm run tsc --generateCpuProfile tsc-output.cpuprofile\n```\n\nThis file can be opened in a chromium based browser like Chrome or Edge Developer in [the CPU profiler](https://developers.google.com/web/tools/chrome-devtools/rendering-tools/js-execution) section.\nYou can learn more about understanding the compilers performance in the [TypeScript wiki section on performance](https://github.com/microsoft/TypeScript/wiki/Performance).",
|
|
622
636
|
"x-intellij-html-description": "\u003cp\u003eThis option gives you the chance to have TypeScript emit a v8 CPU profile during the compiler run. The CPU profile can provide insight into why your builds may be slow.\u003c/p\u003e\n\u003cp\u003eThis option can only be used from the CLI via: \u003ccode\u003e--generateCpuProfile tsc-output.cpuprofile\u003c/code\u003e.\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-sh\"\u003enpm run tsc --generateCpuProfile tsc-output.cpuprofile\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eThis file can be opened in a chromium based browser like Chrome or Edge Developer in \u003ca href=\"https://developers.google.com/web/tools/chrome-devtools/rendering-tools/js-execution\"\u003ethe CPU profiler\u003c/a\u003e section.\nYou can learn more about understanding the compilers performance in the \u003ca href=\"https://github.com/microsoft/TypeScript/wiki/Performance\"\u003eTypeScript wiki section on performance\u003c/a\u003e.\u003c/p\u003e\n"
|
|
623
637
|
},
|
|
638
|
+
"generateTrace": {
|
|
639
|
+
"anyOf": [
|
|
640
|
+
{
|
|
641
|
+
"type": "string"
|
|
642
|
+
},
|
|
643
|
+
{
|
|
644
|
+
"type": "null"
|
|
645
|
+
}
|
|
646
|
+
],
|
|
647
|
+
"description": "Generates an event trace and a list of types in the given directory.",
|
|
648
|
+
"markdownDescription": "Generates an event trace and a list of types in the given directory.",
|
|
649
|
+
"x-intellij-html-description": "\u003cp\u003eGenerates an event trace and a list of types in the given directory.\u003c/p\u003e\n"
|
|
650
|
+
},
|
|
624
651
|
"ignoreDeprecations": {
|
|
625
652
|
"description": "Can be used to silence deprecation warnings about features, that are slated for removal in a future release. For example, if you are using a feature that is deprecated in TypeScript 6.0 but you want to continue using it without seeing warnings until it is removed in TypeScript 7.0, you can set `ignoreDeprecations` to `6.0`.",
|
|
626
653
|
"enum": [
|
|
@@ -1978,6 +2005,20 @@
|
|
|
1978
2005
|
"markdownDescription": "Specify the location where a debugger should locate TypeScript files instead of relative source locations.\nThis string is treated verbatim inside the source-map where you can use a path or a URL:\n\n```json tsconfig\n{\n \"compilerOptions\": {\n \"sourceMap\": true,\n \"sourceRoot\": \"https://my-website.com/debug/source/\"\n }\n}\n```\n\nWould declare that `index.js` will have a source file at `https://my-website.com/debug/source/index.ts`.",
|
|
1979
2006
|
"x-intellij-html-description": "\u003cp\u003eSpecify the location where a debugger should locate TypeScript files instead of relative source locations.\nThis string is treated verbatim inside the source-map where you can use a path or a URL:\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-json\"\u003e{\n \u0026quot;compilerOptions\u0026quot;: {\n \u0026quot;sourceMap\u0026quot;: true,\n \u0026quot;sourceRoot\u0026quot;: \u0026quot;https://my-website.com/debug/source/\u0026quot;\n }\n}\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003eWould declare that \u003ccode\u003eindex.js\u003c/code\u003e will have a source file at \u003ccode\u003ehttps://my-website.com/debug/source/index.ts\u003c/code\u003e.\u003c/p\u003e\n"
|
|
1980
2007
|
},
|
|
2008
|
+
"stableTypeOrdering": {
|
|
2009
|
+
"anyOf": [
|
|
2010
|
+
{
|
|
2011
|
+
"type": "boolean"
|
|
2012
|
+
},
|
|
2013
|
+
{
|
|
2014
|
+
"type": "null"
|
|
2015
|
+
}
|
|
2016
|
+
],
|
|
2017
|
+
"default": false,
|
|
2018
|
+
"description": "Ensure types are ordered stably and deterministically across compilations.",
|
|
2019
|
+
"markdownDescription": "Ensure types are ordered stably and deterministically across compilations.",
|
|
2020
|
+
"x-intellij-html-description": "\u003cp\u003eEnsure types are ordered stably and deterministically across compilations.\u003c/p\u003e\n"
|
|
2021
|
+
},
|
|
1981
2022
|
"strict": {
|
|
1982
2023
|
"anyOf": [
|
|
1983
2024
|
{
|