@effect/tsgo 0.14.6 → 0.16.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 +2 -1
- package/dist/effect-tsgo.js +144 -32
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ This will guide you through the installation process, which includes:
|
|
|
22
22
|
4. Hinting at any additional editor configuration needed to ensure the LSP is active.
|
|
23
23
|
|
|
24
24
|
> [!NOTE]
|
|
25
|
-
> At the moment, you still need
|
|
25
|
+
> At the moment, you still need a native TypeScript install alongside `@effect/tsgo` — either `@typescript/native-preview` (nightlies) or `typescript` >= 7 (e.g. the 7.0 RC, `typescript@rc`). `effect-tsgo patch` and `effect-tsgo setup` detect and use whichever one is installed.
|
|
26
26
|
|
|
27
27
|
## Diagnostic Status
|
|
28
28
|
|
|
@@ -93,6 +93,7 @@ Some diagnostics are off by default or have a default severity of suggestion, bu
|
|
|
93
93
|
<tr><td><code>unsafeEffectTypeAssertion</code></td><td>➖</td><td>🔧</td><td>Detects unsafe type assertions that narrow Effect, Stream, or Layer error or requirements channels</td><td>✓</td><td>✓</td></tr>
|
|
94
94
|
<tr><td colspan="6"><strong>Style</strong> <em>Cleanup, consistency, and idiomatic Effect code.</em></td></tr>
|
|
95
95
|
<tr><td><code>catchAllToMapError</code></td><td>💡</td><td>🔧</td><td>Suggests using Effect.mapError instead of Effect.catch + Effect.fail</td><td>✓</td><td>✓</td></tr>
|
|
96
|
+
<tr><td><code>catchToIgnore</code></td><td>💡</td><td>🔧</td><td>Suggests using Effect.ignore or Effect.ignoreCause instead of Effect.catch/catchCause returning Effect.void</td><td></td><td>✓</td></tr>
|
|
96
97
|
<tr><td><code>catchToOrElseSucceed</code></td><td>💡</td><td>🔧</td><td>Suggests using Effect.orElseSucceed instead of Effect.catch + Effect.succeed</td><td>✓</td><td>✓</td></tr>
|
|
97
98
|
<tr><td><code>deterministicKeys</code></td><td>➖</td><td>🔧</td><td>Enforces deterministic naming for service/tag/error identifiers based on class names</td><td>✓</td><td>✓</td></tr>
|
|
98
99
|
<tr><td><code>effectDoNotation</code></td><td>➖</td><td></td><td>Suggests using Effect.gen or Effect.fn instead of the Effect.Do notation helpers</td><td>✓</td><td>✓</td></tr>
|
package/dist/effect-tsgo.js
CHANGED
|
@@ -204437,17 +204437,47 @@ var FileReadError = class extends TaggedError("FileReadError") {
|
|
|
204437
204437
|
//#endregion
|
|
204438
204438
|
//#region package.json
|
|
204439
204439
|
var name = "@effect/tsgo";
|
|
204440
|
-
var version = "0.
|
|
204440
|
+
var version = "0.16.0";
|
|
204441
204441
|
|
|
204442
204442
|
//#endregion
|
|
204443
204443
|
//#region src/setup/consts.ts
|
|
204444
204444
|
const LSP_PACKAGE_NAME = name;
|
|
204445
204445
|
const LSP_PLUGIN_NAME = "@effect/language-service";
|
|
204446
204446
|
const NATIVE_PREVIEW_PACKAGE_NAME = "@typescript/native-preview";
|
|
204447
|
+
const TYPESCRIPT_PACKAGE_NAME = "typescript";
|
|
204447
204448
|
const PATCH_COMMAND = "effect-tsgo patch";
|
|
204448
204449
|
const DEFAULT_LSP_VERSION = version;
|
|
204449
204450
|
const DEFAULT_NATIVE_PREVIEW_VERSION = "latest";
|
|
204450
204451
|
const TSCONFIG_SCHEMA_URL = "https://raw.githubusercontent.com/Effect-TS/tsgo/refs/heads/main/schema.json";
|
|
204452
|
+
/**
|
|
204453
|
+
* `typescript` package versions >= 7 ship the native Go-ported binary that this
|
|
204454
|
+
* tool patches. Older `typescript` releases (<= 6) are the JS compiler and must
|
|
204455
|
+
* not be treated as a native backend.
|
|
204456
|
+
*/
|
|
204457
|
+
const isNativeTypescriptVersion = (version) => {
|
|
204458
|
+
const match = /\d+/.exec(version.trim());
|
|
204459
|
+
return match !== null && Number(match[0]) >= 7;
|
|
204460
|
+
};
|
|
204461
|
+
/** The `@typescript/native-preview` nightly backend (back-compat default). */
|
|
204462
|
+
const nativePreviewBackend = {
|
|
204463
|
+
packageName: NATIVE_PREVIEW_PACKAGE_NAME,
|
|
204464
|
+
platformPackagePrefix: "@typescript/native-preview",
|
|
204465
|
+
binaryName: "tsgo"
|
|
204466
|
+
};
|
|
204467
|
+
/** The `typescript` >= 7 backend (stable/RC releases). */
|
|
204468
|
+
const typescriptBackend = {
|
|
204469
|
+
packageName: TYPESCRIPT_PACKAGE_NAME,
|
|
204470
|
+
platformPackagePrefix: "@typescript/typescript",
|
|
204471
|
+
binaryName: "tsc",
|
|
204472
|
+
versionCheck: (pkg) => isNativeTypescriptVersion(pkg.version ?? "0")
|
|
204473
|
+
};
|
|
204474
|
+
/**
|
|
204475
|
+
* Resolve the VS Code `typescript.native-preview.tsdk` folder for a backend.
|
|
204476
|
+
* The "TypeScript (Native Preview)" extension reads the native install from
|
|
204477
|
+
* this path; for `@typescript/native-preview` it is `node_modules/<pkg>`, and
|
|
204478
|
+
* for `typescript` >= 7 it is `node_modules/typescript`.
|
|
204479
|
+
*/
|
|
204480
|
+
const nativeBackendTsdkPath = (packageName) => "node_modules/" + packageName;
|
|
204451
204481
|
|
|
204452
204482
|
//#endregion
|
|
204453
204483
|
//#region src/setup/assessment.ts
|
|
@@ -204503,7 +204533,14 @@ const assessPackageJson = (input) => {
|
|
|
204503
204533
|
return none$3();
|
|
204504
204534
|
};
|
|
204505
204535
|
const lspVersion = assessDependency(LSP_PACKAGE_NAME);
|
|
204506
|
-
const nativePreviewVersion = assessDependency(NATIVE_PREVIEW_PACKAGE_NAME)
|
|
204536
|
+
const nativePreviewVersion = orElse(assessDependency(NATIVE_PREVIEW_PACKAGE_NAME), () => {
|
|
204537
|
+
const typescriptDep = assessDependency(TYPESCRIPT_PACKAGE_NAME);
|
|
204538
|
+
if (isSome(typescriptDep) && isNativeTypescriptVersion(typescriptDep.value.version)) return some({
|
|
204539
|
+
...typescriptDep.value,
|
|
204540
|
+
packageName: TYPESCRIPT_PACKAGE_NAME
|
|
204541
|
+
});
|
|
204542
|
+
return none$3();
|
|
204543
|
+
});
|
|
204507
204544
|
const prepareScript = "prepare" in (parsed.scripts ?? {}) ? some({
|
|
204508
204545
|
script: parsed.scripts.prepare,
|
|
204509
204546
|
hasPatch: parsed.scripts.prepare.toLowerCase().includes(PATCH_COMMAND)
|
|
@@ -204853,13 +204890,17 @@ const computePackageJsonChanges = (current, target) => {
|
|
|
204853
204890
|
if (!rootObj) return emptyFileChangesResult();
|
|
204854
204891
|
const ctx = createTrackerContext();
|
|
204855
204892
|
const fileChange = tsInternal.textChanges.ChangeTracker.with(ctx, (tracker) => {
|
|
204893
|
+
const nativeBackendPackageName = match$8(target.nativePreviewVersion, {
|
|
204894
|
+
onNone: () => NATIVE_PREVIEW_PACKAGE_NAME,
|
|
204895
|
+
onSome: (dep) => dep.packageName ?? NATIVE_PREVIEW_PACKAGE_NAME
|
|
204896
|
+
});
|
|
204856
204897
|
const shouldAddNativePreviewWithDependencyType = (dependencyType) => isSome(target.nativePreviewVersion) && isNone(current.nativePreviewVersion) && target.nativePreviewVersion.value.dependencyType === dependencyType;
|
|
204857
204898
|
const ensureNativePreviewDependency = () => {
|
|
204858
204899
|
if (isNone(target.nativePreviewVersion) || isSome(current.nativePreviewVersion)) return;
|
|
204859
204900
|
const targetNativePreview = target.nativePreviewVersion.value;
|
|
204860
204901
|
if (!findDependencyCollectionProperty(rootObj, targetNativePreview.dependencyType) && isSome(target.lspVersion) && target.lspVersion.value.dependencyType === targetNativePreview.dependencyType) return;
|
|
204861
|
-
descriptions.push(`Add ${
|
|
204862
|
-
upsertDependency(tracker, current.sourceFile, rootObj,
|
|
204902
|
+
descriptions.push(`Add ${nativeBackendPackageName}@${targetNativePreview.version} to ${targetNativePreview.dependencyType}`);
|
|
204903
|
+
upsertDependency(tracker, current.sourceFile, rootObj, nativeBackendPackageName, targetNativePreview);
|
|
204863
204904
|
};
|
|
204864
204905
|
if (isSome(target.lspVersion)) {
|
|
204865
204906
|
const targetDepType = target.lspVersion.value.dependencyType;
|
|
@@ -204879,7 +204920,7 @@ const computePackageJsonChanges = (current, target) => {
|
|
|
204879
204920
|
const dependencyProperties = [import_typescript.factory.createPropertyAssignment(import_typescript.factory.createStringLiteral(LSP_PACKAGE_NAME), import_typescript.factory.createStringLiteral(targetVersion))];
|
|
204880
204921
|
if (shouldAddNativePreviewWithDependencyType(targetDepType)) {
|
|
204881
204922
|
const targetNativePreview = target.nativePreviewVersion.pipe(getOrUndefined);
|
|
204882
|
-
if (targetNativePreview) dependencyProperties.push(import_typescript.factory.createPropertyAssignment(import_typescript.factory.createStringLiteral(
|
|
204923
|
+
if (targetNativePreview) dependencyProperties.push(import_typescript.factory.createPropertyAssignment(import_typescript.factory.createStringLiteral(nativeBackendPackageName), import_typescript.factory.createStringLiteral(targetNativePreview.version)));
|
|
204883
204924
|
}
|
|
204884
204925
|
const newDepsProp = import_typescript.factory.createPropertyAssignment(import_typescript.factory.createStringLiteral(targetDepType), import_typescript.factory.createObjectLiteralExpression(dependencyProperties, false));
|
|
204885
204926
|
insertNodeAtEndOfList(tracker, current.sourceFile, rootObj.properties, newDepsProp);
|
|
@@ -204899,7 +204940,7 @@ const computePackageJsonChanges = (current, target) => {
|
|
|
204899
204940
|
const dependencyProperties = [import_typescript.factory.createPropertyAssignment(import_typescript.factory.createStringLiteral(LSP_PACKAGE_NAME), import_typescript.factory.createStringLiteral(targetVersion))];
|
|
204900
204941
|
if (shouldAddNativePreviewWithDependencyType(targetDepType)) {
|
|
204901
204942
|
const targetNativePreview = target.nativePreviewVersion.pipe(getOrUndefined);
|
|
204902
|
-
if (targetNativePreview) dependencyProperties.push(import_typescript.factory.createPropertyAssignment(import_typescript.factory.createStringLiteral(
|
|
204943
|
+
if (targetNativePreview) dependencyProperties.push(import_typescript.factory.createPropertyAssignment(import_typescript.factory.createStringLiteral(nativeBackendPackageName), import_typescript.factory.createStringLiteral(targetNativePreview.version)));
|
|
204903
204944
|
}
|
|
204904
204945
|
const newDepsProp = import_typescript.factory.createPropertyAssignment(import_typescript.factory.createStringLiteral(targetDepType), import_typescript.factory.createObjectLiteralExpression(dependencyProperties, false));
|
|
204905
204946
|
insertNodeAtEndOfList(tracker, current.sourceFile, rootObj.properties, newDepsProp);
|
|
@@ -206246,6 +206287,23 @@ var rules = [
|
|
|
206246
206287
|
}]
|
|
206247
206288
|
}
|
|
206248
206289
|
},
|
|
206290
|
+
{
|
|
206291
|
+
"name": "catchToIgnore",
|
|
206292
|
+
"group": "style",
|
|
206293
|
+
"description": "Suggests using Effect.ignore or Effect.ignoreCause instead of Effect.catch/catchCause returning Effect.void",
|
|
206294
|
+
"defaultSeverity": "suggestion",
|
|
206295
|
+
"fixable": true,
|
|
206296
|
+
"supportedEffect": ["v4"],
|
|
206297
|
+
"codes": [377099],
|
|
206298
|
+
"preview": {
|
|
206299
|
+
"sourceText": "import { Effect } from \"effect\"\n\ndeclare const program: Effect.Effect<void, string, never>\n\nexport const recovered = program.pipe(\n Effect.catch(() => Effect.void)\n)\n",
|
|
206300
|
+
"diagnostics": [{
|
|
206301
|
+
"start": 133,
|
|
206302
|
+
"end": 145,
|
|
206303
|
+
"text": "`Effect.ignore` expresses ignored failure more directly than `Effect.catch` returning `Effect.void`. effect(catchToIgnore)"
|
|
206304
|
+
}]
|
|
206305
|
+
}
|
|
206306
|
+
},
|
|
206249
206307
|
{
|
|
206250
206308
|
"name": "catchToOrElseSucceed",
|
|
206251
206309
|
"group": "style",
|
|
@@ -207320,8 +207378,12 @@ const gatherTargetState = (assessment, context) => gen(function* () {
|
|
|
207320
207378
|
}
|
|
207321
207379
|
]
|
|
207322
207380
|
});
|
|
207381
|
+
const nativeBackendPackage = match$8(assessment.packageJson.nativePreviewVersion, {
|
|
207382
|
+
onNone: () => NATIVE_PREVIEW_PACKAGE_NAME,
|
|
207383
|
+
onSome: (dep) => dep.packageName ?? NATIVE_PREVIEW_PACKAGE_NAME
|
|
207384
|
+
});
|
|
207323
207385
|
const vscodeSettings = editors.includes("vscode") ? some({ settings: {
|
|
207324
|
-
"typescript.native-preview.tsdk":
|
|
207386
|
+
"typescript.native-preview.tsdk": nativeBackendTsdkPath(nativeBackendPackage),
|
|
207325
207387
|
"typescript.experimental.useTsgo": true,
|
|
207326
207388
|
"js/ts.experimental.useTsgo": true
|
|
207327
207389
|
} }) : none$3();
|
|
@@ -207357,19 +207419,19 @@ const setupCommand = make("setup").pipe(withDescription("Setup @effect/tsgo for
|
|
|
207357
207419
|
|
|
207358
207420
|
//#endregion
|
|
207359
207421
|
//#region src/cli.ts
|
|
207360
|
-
var
|
|
207422
|
+
var NativeBackendNotInstalledError = class extends TaggedError("NativeBackendNotInstalledError") {
|
|
207361
207423
|
get message() {
|
|
207362
|
-
return "
|
|
207424
|
+
return "No native TypeScript backend is installed. Install one of the following first: `@typescript/native-preview` or `typescript` (>= 7, e.g. `typescript@rc`).";
|
|
207363
207425
|
}
|
|
207364
207426
|
};
|
|
207365
207427
|
var UnsupportedPlatformPackageError = class extends TaggedError("UnsupportedPlatformPackageError") {
|
|
207366
207428
|
get message() {
|
|
207367
|
-
return `Unable to resolve ${this.packageName}. Your platform may not be supported by
|
|
207429
|
+
return `Unable to resolve ${this.packageName}. Your platform may not be supported by the installed native TypeScript backend.`;
|
|
207368
207430
|
}
|
|
207369
207431
|
};
|
|
207370
207432
|
var MissingTargetBinaryError = class extends TaggedError("MissingTargetBinaryError") {
|
|
207371
207433
|
get message() {
|
|
207372
|
-
return "TypeScript
|
|
207434
|
+
return "Native TypeScript binary not found at " + this.targetPath + ". Is the native TypeScript backend installed correctly?";
|
|
207373
207435
|
}
|
|
207374
207436
|
};
|
|
207375
207437
|
var ResolvePackagedBinaryError = class extends TaggedError("ResolvePackagedBinaryError") {
|
|
@@ -207397,24 +207459,74 @@ var VerificationFailedError = class extends TaggedError("VerificationFailedError
|
|
|
207397
207459
|
return "Warning: verification failed for " + this.targetPath + ", but binary was patched. The binary may still work correctly.";
|
|
207398
207460
|
}
|
|
207399
207461
|
};
|
|
207400
|
-
const
|
|
207462
|
+
const probeBackend = (backend, cwdRequire, path) => {
|
|
207463
|
+
const isWin = process.platform === "win32";
|
|
207464
|
+
let mainPkg;
|
|
207465
|
+
try {
|
|
207466
|
+
mainPkg = cwdRequire(backend.packageName + "/package.json");
|
|
207467
|
+
} catch {
|
|
207468
|
+
return { _tag: "notInstalled" };
|
|
207469
|
+
}
|
|
207470
|
+
if (backend.versionCheck !== void 0 && !backend.versionCheck(mainPkg)) return { _tag: "notInstalled" };
|
|
207471
|
+
let mainPackageJsonPath;
|
|
207472
|
+
try {
|
|
207473
|
+
mainPackageJsonPath = cwdRequire.resolve(backend.packageName + "/package.json");
|
|
207474
|
+
} catch {
|
|
207475
|
+
return { _tag: "notInstalled" };
|
|
207476
|
+
}
|
|
207477
|
+
const backendRequire = node_module.createRequire(mainPackageJsonPath);
|
|
207478
|
+
const platformPackageName = backend.platformPackagePrefix + "-" + process.platform + "-" + process.arch;
|
|
207479
|
+
let platformPackageJsonPath;
|
|
207480
|
+
try {
|
|
207481
|
+
platformPackageJsonPath = backendRequire.resolve(platformPackageName + "/package.json");
|
|
207482
|
+
} catch {
|
|
207483
|
+
return {
|
|
207484
|
+
_tag: "unsupportedPlatform",
|
|
207485
|
+
packageName: platformPackageName
|
|
207486
|
+
};
|
|
207487
|
+
}
|
|
207488
|
+
const platformDir = path.dirname(platformPackageJsonPath);
|
|
207489
|
+
const binaryName = backend.binaryName + (isWin ? ".exe" : "");
|
|
207490
|
+
return {
|
|
207491
|
+
_tag: "resolved",
|
|
207492
|
+
path: path.join(platformDir, "lib", binaryName),
|
|
207493
|
+
binaryName: backend.binaryName
|
|
207494
|
+
};
|
|
207495
|
+
};
|
|
207496
|
+
/**
|
|
207497
|
+
* Resolve the native TypeScript binary to patch. The `@typescript/native-preview`
|
|
207498
|
+
* backend is tried first (back-compat), then the `typescript` >= 7 package so
|
|
207499
|
+
* that the TypeScript 7 RC/stable release is supported out of the box.
|
|
207500
|
+
*
|
|
207501
|
+
* Returns the target binary path plus the backend's base binary name (`tsgo` or
|
|
207502
|
+
* `tsc`); the latter selects the matching Effect-patched artifact from
|
|
207503
|
+
* `@effect/tsgo-*` (which ships separate `lib/tsgo` and `lib/tsc` builds).
|
|
207504
|
+
*/
|
|
207505
|
+
const getNativeBackendBinaryPath = gen(function* () {
|
|
207401
207506
|
const path = yield* Path;
|
|
207402
207507
|
const cwdRequire = node_module.createRequire(path.join(process.cwd(), "noop.js"));
|
|
207403
|
-
const
|
|
207404
|
-
|
|
207405
|
-
|
|
207406
|
-
|
|
207407
|
-
|
|
207408
|
-
|
|
207409
|
-
const
|
|
207410
|
-
|
|
207411
|
-
|
|
207412
|
-
|
|
207413
|
-
|
|
207414
|
-
|
|
207415
|
-
return
|
|
207508
|
+
const nativePreviewResult = probeBackend(nativePreviewBackend, cwdRequire, path);
|
|
207509
|
+
if (nativePreviewResult._tag === "resolved") return {
|
|
207510
|
+
targetPath: nativePreviewResult.path,
|
|
207511
|
+
binaryName: nativePreviewResult.binaryName
|
|
207512
|
+
};
|
|
207513
|
+
if (nativePreviewResult._tag === "unsupportedPlatform") return yield* fail(new UnsupportedPlatformPackageError({ packageName: nativePreviewResult.packageName }));
|
|
207514
|
+
const typescriptResult = probeBackend(typescriptBackend, cwdRequire, path);
|
|
207515
|
+
if (typescriptResult._tag === "resolved") return {
|
|
207516
|
+
targetPath: typescriptResult.path,
|
|
207517
|
+
binaryName: typescriptResult.binaryName
|
|
207518
|
+
};
|
|
207519
|
+
if (typescriptResult._tag === "unsupportedPlatform") return yield* fail(new UnsupportedPlatformPackageError({ packageName: typescriptResult.packageName }));
|
|
207520
|
+
return yield* fail(new NativeBackendNotInstalledError({ details: "no native backend found" }));
|
|
207416
207521
|
});
|
|
207417
|
-
|
|
207522
|
+
/**
|
|
207523
|
+
* Resolve the Effect-patched binary to copy over the native target. The
|
|
207524
|
+
* `@effect/tsgo-*` platform package ships separate `lib/tsgo` (built from
|
|
207525
|
+
* `main`) and `lib/tsc` (built from `generated/stable`) artifacts; `binaryName`
|
|
207526
|
+
* selects the one matching the detected native backend so the correct build is
|
|
207527
|
+
* installed. Defaults to `tsgo` for the `get-exe-path` command.
|
|
207528
|
+
*/
|
|
207529
|
+
const getPackagedBinaryPath = (binaryName = "tsgo") => gen(function* () {
|
|
207418
207530
|
const fs = yield* FileSystem;
|
|
207419
207531
|
const path = yield* Path;
|
|
207420
207532
|
const packageName = "@effect/tsgo-" + process.platform + "-" + process.arch;
|
|
@@ -207424,17 +207536,17 @@ const getPackagedBinaryPath = gen(function* () {
|
|
|
207424
207536
|
catch: () => new ResolvePackagedBinaryError({ reason: `Unable to resolve ${packageName}. Either your platform is unsupported, or the platform package is not installed.` })
|
|
207425
207537
|
});
|
|
207426
207538
|
const packageDir = path.dirname(packageJsonPath);
|
|
207427
|
-
const
|
|
207428
|
-
const exePath = path.join(packageDir, "lib",
|
|
207539
|
+
const exeName = binaryName + (process.platform === "win32" ? ".exe" : "");
|
|
207540
|
+
const exePath = path.join(packageDir, "lib", exeName);
|
|
207429
207541
|
if (!(yield* fs.exists(exePath))) return yield* fail(new ResolvePackagedBinaryError({ reason: "Executable not found: " + exePath }));
|
|
207430
207542
|
return exePath;
|
|
207431
207543
|
});
|
|
207432
207544
|
const patch = gen(function* () {
|
|
207433
207545
|
const fs = yield* FileSystem;
|
|
207434
207546
|
const path = yield* Path;
|
|
207435
|
-
const targetPath = yield*
|
|
207547
|
+
const { targetPath, binaryName } = yield* getNativeBackendBinaryPath;
|
|
207436
207548
|
const backupPath = path.join(path.dirname(targetPath), path.basename(targetPath) + ".original");
|
|
207437
|
-
const ourBinaryPath = yield* getPackagedBinaryPath;
|
|
207549
|
+
const ourBinaryPath = yield* getPackagedBinaryPath(binaryName);
|
|
207438
207550
|
if (!(yield* fs.exists(targetPath))) return yield* fail(new MissingTargetBinaryError({ targetPath }));
|
|
207439
207551
|
let actualBackupPath = backupPath;
|
|
207440
207552
|
let counter = 1;
|
|
@@ -207464,7 +207576,7 @@ const patch = gen(function* () {
|
|
|
207464
207576
|
const unpatch = gen(function* () {
|
|
207465
207577
|
const fs = yield* FileSystem;
|
|
207466
207578
|
const path = yield* Path;
|
|
207467
|
-
const targetPath = yield*
|
|
207579
|
+
const { targetPath } = yield* getNativeBackendBinaryPath;
|
|
207468
207580
|
const backupPath = path.join(path.dirname(targetPath), path.basename(targetPath) + ".original");
|
|
207469
207581
|
if (!(yield* fs.exists(backupPath))) {
|
|
207470
207582
|
yield* error("No backup found at " + backupPath + ". Nothing to restore.");
|
|
@@ -207483,7 +207595,7 @@ const unpatch = gen(function* () {
|
|
|
207483
207595
|
});
|
|
207484
207596
|
const patchCommand = make("patch").pipe(withDescription("Patch the Effect Language Service binary"), withHandler(() => patch));
|
|
207485
207597
|
const unpatchCommand = make("unpatch").pipe(withDescription("Unpatch and restore the original TypeScript-Go binary"), withHandler(() => unpatch));
|
|
207486
|
-
const getExePathCommand = make("get-exe-path").pipe(withDescription("Print the Effect Language Service executable path"), withHandler(() => getPackagedBinaryPath.pipe(flatMap((exePath) => log(exePath)))));
|
|
207598
|
+
const getExePathCommand = make("get-exe-path").pipe(withDescription("Print the Effect Language Service executable path"), withHandler(() => getPackagedBinaryPath().pipe(flatMap((exePath) => log(exePath)))));
|
|
207487
207599
|
make("tsgo").pipe(withSubcommands([
|
|
207488
207600
|
patchCommand,
|
|
207489
207601
|
unpatchCommand,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect/tsgo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "Effect Language Service for TypeScript-Go — Effect-specific diagnostics and hover features.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
"README.md"
|
|
23
23
|
],
|
|
24
24
|
"optionalDependencies": {
|
|
25
|
-
"@effect/tsgo-win32-x64": "0.
|
|
26
|
-
"@effect/tsgo-win32-arm64": "0.
|
|
27
|
-
"@effect/tsgo-linux-x64": "0.
|
|
28
|
-
"@effect/tsgo-linux-arm64": "0.
|
|
29
|
-
"@effect/tsgo-linux-arm": "0.
|
|
30
|
-
"@effect/tsgo-darwin-x64": "0.
|
|
31
|
-
"@effect/tsgo-darwin-arm64": "0.
|
|
25
|
+
"@effect/tsgo-win32-x64": "0.16.0",
|
|
26
|
+
"@effect/tsgo-win32-arm64": "0.16.0",
|
|
27
|
+
"@effect/tsgo-linux-x64": "0.16.0",
|
|
28
|
+
"@effect/tsgo-linux-arm64": "0.16.0",
|
|
29
|
+
"@effect/tsgo-linux-arm": "0.16.0",
|
|
30
|
+
"@effect/tsgo-darwin-x64": "0.16.0",
|
|
31
|
+
"@effect/tsgo-darwin-arm64": "0.16.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@effect/platform-node": "^4.0.0-beta.83",
|