Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .changeset/green-years-tan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
"@effect/platform-node": patch
"@effect/experimental": patch
"@effect/typeclass": patch
"@effect/platform": patch
"@effect/printer": patch
"effect": patch
"@effect/sql-pg": patch
"@effect/cli": patch
"@effect/sql": patch
---

Wrap JSDoc @example tags with a TypeScript fence, closes #4002
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,10 @@ Output:

Output:

```
````
*
* @example
* ```ts
* import { Effect } from "effect"
*
* console.log(Effect.runSyncExit(Effect.succeed(1)))
Expand All @@ -122,8 +123,9 @@ Output:
* // _tag: "Success",
* // value: 1
* // }
* ```
*
```
````

By using this utility, you can save time and maintain consistency in your JSDoc comments, especially for complex examples.

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"@changesets/cli": "^2.27.7",
"@edge-runtime/vm": "^4.0.0",
"@effect/build-utils": "^0.7.7",
"@effect/docgen": "^0.4.4",
"@effect/docgen": "^0.5.1",
"@effect/dtslint": "^0.1.2",
"@effect/eslint-plugin": "^0.2.0",
"@effect/language-service": "^0.1.0",
Expand Down
4 changes: 4 additions & 0 deletions packages/cli/src/Options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,14 @@ export const boolean: (name: string, options?: Options.BooleanOptionsConfig) =>
* inputs. The input will be mapped to it's associated value during parsing.
*
* @example
* ```ts
* import * as Options from "@effect/cli/Options"
*
* export const animal: Options.Options<"dog" | "cat"> = Options.choice(
* "animal",
* ["dog", "cat"]
* )
* ```
*
* @since 1.0.0
* @category constructors
Expand All @@ -174,6 +176,7 @@ export const choice: <A extends string, C extends ReadonlyArray<A>>(
* inputs. The input will be mapped to it's associated value during parsing.
*
* @example
* ```ts
* import * as Options from "@effect/cli/Options"
* import * as Data from "effect/Data"
*
Expand All @@ -195,6 +198,7 @@ export const choice: <A extends string, C extends ReadonlyArray<A>>(
* ["dog", Dog()],
* ["cat", Cat()],
* ])
* ```
*
* @since 1.0.0
* @category constructors
Expand Down
2 changes: 2 additions & 0 deletions packages/cli/src/Prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,7 @@ export declare namespace All {
* as an argument.
*
* @example
* ```ts
* import * as Prompt from "@effect/cli/Prompt"
* import * as NodeContext from "@effect/platform-node/NodeContext"
* import * as Runtime from "@effect/platform-node/NodeRuntime"
Expand All @@ -537,6 +538,7 @@ export declare namespace All {
* const allWithTuple = Prompt.all([username, password])
*
* const allWithRecord = Prompt.all({ username, password })
* ```
*
* @since 1.0.0
* @category collecting & elements
Expand Down
Loading