Commit a5fb8fe
Update bun minor+patch updates (#29)
This PR contains the following updates:
| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [@effect/language-service](https://github.com/Effect-TS/language-service) | [`^0.60.0` → `^0.65.0`](https://renovatebot.com/diffs/npm/@effect%2flanguage-service/0.60.0/0.65.0) |  |  |
| [@effect/platform](https://effect.website) ([source](https://github.com/Effect-TS/effect/tree/HEAD/packages/platform)) | [`^0.93.6` → `^0.94.0`](https://renovatebot.com/diffs/npm/@effect%2fplatform/0.93.8/0.94.1) |  |  |
| [@effect/platform-browser](https://effect.website) ([source](https://github.com/Effect-TS/effect/tree/HEAD/packages/platform-browser)) | [`^0.73.0` → `^0.74.0`](https://renovatebot.com/diffs/npm/@effect%2fplatform-browser/0.73.0/0.74.0) |  |  |
---
### Release Notes
<details>
<summary>Effect-TS/language-service (@​effect/language-service)</summary>
### [`v0.65.0`](https://github.com/Effect-TS/language-service/blob/HEAD/CHANGELOG.md#0650)
[Compare Source](Effect-TS/language-service@v0.64.1...v0.65.0)
##### Minor Changes
- [#​581](Effect-TS/language-service#581) [`4569328`](Effect-TS/language-service@4569328) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Add `effectFnOpportunity` diagnostic that suggests converting functions returning `Effect.gen` to `Effect.fn` for better tracing and concise syntax.
The diagnostic triggers on:
- Arrow functions returning `Effect.gen(...)`
- Function expressions returning `Effect.gen(...)`
- Function declarations returning `Effect.gen(...)`
- Functions with `Effect.gen(...).pipe(...)` patterns
It provides two code fixes:
- Convert to `Effect.fn` (traced) - includes the function name as the span name
- Convert to `Effect.fnUntraced` - without tracing
The diagnostic skips:
- Generator functions (can't be converted)
- Named function expressions (typically used for recursion)
- Functions with multiple call signatures (overloads)
When the original function has a return type annotation, the converted function will use `Effect.fn.Return<A, E, R>` as the return type.
Example:
```ts
// Before
export const myFunction = (a: number) =>
Effect.gen(function* () {
yield* Effect.succeed(1);
return a;
});
// After (with Effect.fn)
export const myFunction = Effect.fn("myFunction")(function* (a: number) {
yield* Effect.succeed(1);
return a;
});
// Before (with pipe)
export const withPipe = () =>
Effect.gen(function* () {
return yield* Effect.succeed(1);
}).pipe(Effect.withSpan("withPipe"));
// After (with Effect.fn)
export const withPipe = Effect.fn("withPipe")(function* () {
return yield* Effect.succeed(1);
}, Effect.withSpan("withPipe"));
```
- [#​575](Effect-TS/language-service#575) [`00aeed0`](Effect-TS/language-service@00aeed0) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Add `effectMapVoid` diagnostic that suggests using `Effect.asVoid` instead of `Effect.map(() => void 0)`, `Effect.map(() => undefined)`, or `Effect.map(() => {})`.
Also adds two new TypeParser utilities:
- `lazyExpression`: matches zero-argument arrow functions or function expressions that return a single expression
- `emptyFunction`: matches arrow functions or function expressions with an empty block body
And adds `isVoidExpression` utility to TypeScriptUtils for detecting `void 0` or `undefined` expressions.
Example:
```ts
// Before
Effect.succeed(1).pipe(Effect.map(() => void 0));
Effect.succeed(1).pipe(Effect.map(() => undefined));
Effect.succeed(1).pipe(Effect.map(() => {}));
// After (suggested fix)
Effect.succeed(1).pipe(Effect.asVoid);
```
- [#​582](Effect-TS/language-service#582) [`94d4a6b`](Effect-TS/language-service@94d4a6b) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Added `layerinfo` CLI command that provides detailed information about a specific exported layer.
Features:
- Shows layer type, location, and description
- Lists services the layer provides and requires
- Suggests optimal layer composition order using `Layer.provide`, `Layer.provideMerge`, and `Layer.merge`
Example usage:
```bash
effect-language-service layerinfo --file ./src/layers/app.ts --name AppLive
```
Also added a tip to both `overview` and `layerinfo` commands about using `Layer.mergeAll(...)` to get suggested composition order.
- [#​583](Effect-TS/language-service#583) [`b0aa78f`](Effect-TS/language-service@b0aa78f) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Add `redundantSchemaTagIdentifier` diagnostic that suggests removing redundant identifier arguments when they equal the tag value in `Schema.TaggedClass`, `Schema.TaggedError`, or `Schema.TaggedRequest`.
**Before:**
```typescript
class MyError extends Schema.TaggedError<MyError>("MyError")("MyError", {
message: Schema.String,
}) {}
```
**After applying the fix:**
```typescript
class MyError extends Schema.TaggedError<MyError>()("MyError", {
message: Schema.String,
}) {}
```
Also updates the completions to not include the redundant identifier when autocompleting `Schema.TaggedClass`, `Schema.TaggedError`, and `Schema.TaggedRequest`.
- [#​573](Effect-TS/language-service#573) [`6715f91`](Effect-TS/language-service@6715f91) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Rename `reportSuggestionsAsWarningsInTsc` option to `includeSuggestionsInTsc` and change default to `true`.
This option controls whether diagnostics with "suggestion" severity are included in TSC output when using the `effect-language-service patch` feature. When enabled, suggestions are reported as messages in TSC output, which is useful for LLM-based development tools to see all suggestions.
**Breaking change**: The option has been renamed and the default behavior has changed:
- Old: `reportSuggestionsAsWarningsInTsc: false` (suggestions not included by default)
- New: `includeSuggestionsInTsc: true` (suggestions included by default)
To restore the previous behavior, set `"includeSuggestionsInTsc": false` in your tsconfig.json plugin configuration.
- [#​586](Effect-TS/language-service#586) [`e225b5f`](Effect-TS/language-service@e225b5f) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Add markdown documentation support to setup command
The setup command now automatically manages Effect Language Service documentation in AGENTS.md and CLAUDE.md files:
- When installing: Adds or updates the Effect Language Service section with markers
- When uninstalling: Removes the section if present
- Case-insensitive file detection (supports both lowercase and uppercase filenames)
- Skips symlinked files to avoid modifying linked content
- Shows proper diff view for markdown file changes
Example section added to markdown files:
```markdown
<!-- effect-language-service:start -->
## Effect Language Service
The Effect Language Service comes in with a useful CLI that can help you with commands to get a better understanding your Effect Layers and Services, and to help you compose them correctly.
<!-- effect-language-service:end -->
```
##### Patch Changes
- [#​580](Effect-TS/language-service#580) [`a45606b`](Effect-TS/language-service@a45606b) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Add `Effect.fn` and `Effect.fnUntraced` support to the piping flows parser.
The piping flows parser now recognizes pipe transformations passed as additional arguments to `Effect.fn`, `Effect.fn("traced")`, and `Effect.fnUntraced`. This enables diagnostics like `catchAllToMapError`, `catchUnfailableEffect`, and `multipleEffectProvide` to work with these patterns.
Example:
```ts
// This will now trigger the catchAllToMapError diagnostic
const example = Effect.fn(
function* () {
return yield* Effect.fail("error");
},
Effect.catchAll((cause) => Effect.fail(new MyError(cause)))
);
```
- [#​587](Effect-TS/language-service#587) [`7316859`](Effect-TS/language-service@7316859) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Mark deprecated TypeScript Signature methods and migrate to property accessors
Added `@deprecated` annotations to TypeScript Signature interface methods (`getParameters`, `getTypeParameters`, `getDeclaration`, `getReturnType`, `getTypeParameterAtPosition`) with guidance to use their modern property alternatives. Updated codebase usage of `getParameters()` to use `.parameters` property instead.
- [#​584](Effect-TS/language-service#584) [`ed12861`](Effect-TS/language-service@ed12861) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Fix TypeError in setup command when updating existing diagnosticSeverity configuration
The setup command was throwing `TypeError: Cannot read properties of undefined (reading 'text')` when trying to update the `diagnosticSeverity` option of an existing `@effect/language-service` plugin configuration in tsconfig.json.
This occurred because TypeScript's ChangeTracker formatter needed to compute indentation by traversing the AST tree, which failed when replacing a PropertyAssignment node inside a nested list context.
The fix replaces just the initializer value (ObjectLiteralExpression) instead of the entire PropertyAssignment, avoiding the problematic list indentation calculation.
- [#​585](Effect-TS/language-service#585) [`7ebe5db`](Effect-TS/language-service@7ebe5db) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Enhanced `layerinfo` CLI command with output type selection for layer composition.
**New Features:**
- Added `--outputs` option to select which output types to include in the suggested composition (e.g., `--outputs 1,2,3`)
- Shows all available output types from the layer graph with indexed checkboxes
- By default, only types that are in the layer's declared `ROut` are selected
- Composition code now includes `export const <name> = ...` prefix for easy copy-paste
**Example output:**
```
Suggested Composition:
Not sure you got your composition right? Just write all layers inside a Layer.mergeAll(...)
then run this command again and use --outputs to select which outputs to include in composition.
Example: --outputs 1,2,3
[ ] 1. Cache
[x] 2. UserRepository
export const simplePipeIn = UserRepository.Default.pipe(
Layer.provide(Cache.Default)
)
```
This allows users to see all available outputs from a layer composition and choose which ones to include in the suggested composition order.
- [#​577](Effect-TS/language-service#577) [`0ed50c3`](Effect-TS/language-service@0ed50c3) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Refactor `catchAllToMapError` diagnostic to use the piping flows parser for detecting Effect.catchAll calls.
This change also:
- Makes `outType` optional in `ParsedPipingFlowSubject` to handle cases where type information is unavailable
- Sorts piping flows by position for consistent ordering
- [#​578](Effect-TS/language-service#578) [`cab6ce8`](Effect-TS/language-service@cab6ce8) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - refactor: use piping flows parser in catchUnfailableEffect diagnostic
- [#​579](Effect-TS/language-service#579) [`2a82522`](Effect-TS/language-service@2a82522) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - refactor: use piping flows parser in multipleEffectProvide diagnostic
- [#​570](Effect-TS/language-service#570) [`0db6e28`](Effect-TS/language-service@0db6e28) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Refactor CLI overview command to extract symbol collection logic into reusable utility
- Extract `collectSourceFileExportedSymbols` into `src/cli/utils/ExportedSymbols.ts` for reuse across CLI commands
- Add `--max-symbol-depth` option to overview command (default: 3) to control how deep to traverse nested symbol properties
- Add tests for the overview command with snapshot testing
- [#​574](Effect-TS/language-service#574) [`9d0695e`](Effect-TS/language-service@9d0695e) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Remove deprecated ts-patch documentation from README. The Effect LSP CLI Patch is now the only recommended approach for getting diagnostics at compile time.
- [#​576](Effect-TS/language-service#576) [`5017d75`](Effect-TS/language-service@5017d75) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Add piping flows parser for caching piping flow analysis per source file.
This internal improvement introduces a `pipingFlows` function in `TypeParser` that analyzes and caches all piping flows (both `pipe()` calls and `.pipe()` method chains) in a source file. The parser:
- Identifies piping flows including nested pipes and mixed call styles (e.g., `Effect.map(effect, fn).pipe(...)`)
- Tracks the subject, transformations, and intermediate types for each flow
- Enables more efficient diagnostic implementations by reusing cached analysis
The `missedPipeableOpportunity` diagnostic has been refactored to use this new parser, improving performance when analyzing files with multiple piping patterns.
### [`v0.64.1`](https://github.com/Effect-TS/language-service/blob/HEAD/CHANGELOG.md#0641)
[Compare Source](Effect-TS/language-service@v0.64.0...v0.64.1)
##### Patch Changes
- [#​568](Effect-TS/language-service#568) [`477271d`](Effect-TS/language-service@477271d) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Fix auto-import with namespace import packages generating malformed code when the identifier is at the beginning of the file.
When using `namespaceImportPackages` configuration and auto-completing an export like `isAnyKeyword` from `effect/SchemaAST`, the code was incorrectly generated as:
```ts
SchemaAST.import * as SchemaAST from "effect/SchemaAST";
```
Instead of the expected:
```ts
import * as SchemaAST from "effect/SchemaAST";
SchemaAST.isAnyKeyword;
```
The fix ensures the import statement is added before the namespace prefix when both changes target position 0.
### [`v0.64.0`](https://github.com/Effect-TS/language-service/blob/HEAD/CHANGELOG.md#0640)
[Compare Source](Effect-TS/language-service@v0.63.2...v0.64.0)
##### Minor Changes
- [#​567](Effect-TS/language-service#567) [`dcb3fe5`](Effect-TS/language-service@dcb3fe5) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Added new diagnostic `catchAllToMapError` that suggests using `Effect.mapError` instead of `Effect.catchAll` + `Effect.fail` when the callback only wraps the error.
Before:
```ts
Effect.catchAll((cause) => Effect.fail(new MyError(cause)));
```
After:
```ts
Effect.mapError((cause) => new MyError(cause));
```
The diagnostic includes a quick fix that automatically transforms the code.
- [#​555](Effect-TS/language-service#555) [`0424000`](Effect-TS/language-service@0424000) Thanks [@​mattiamanzati](https://github.com/mattiamanzati)! - Add `globalErrorInEffectCatch` diagnostic to detect global Error types in catch callbacks
This new diagnostic warns when catch callbacks in `Effect.tryPromise`, `Effect.try`, `Effect.tryMap`, or `Effect.tryMapPromise` return the global `Error` type instead of typed errors.
Using the global `Error` type in Effect failures is not recommended as they can get merged together, making it harder to distinguish between different error cases. Instead, it's better to use tagged errors (like `Data.TaggedError`) or custom errors with discriminator properties to enable proper type checking and error handling.
Example of code that triggers the diagnostic:
```typescript
Effect.tryPromise({
try: () => fetch("http://example.com"),
catch: () => new Error("Request failed"), // 1 parent 7b8a83d commit a5fb8fe
3 files changed
+5
-5
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
| 29 | + | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
0 commit comments