Skip to content

Commit 944025b

Browse files
authored
Wrap JSDoc @example tags with a TypeScript fence, closes #4002 (#4007)
1 parent 24b4dba commit 944025b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+2038
-184
lines changed

.changeset/green-years-tan.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
"@effect/platform-node": patch
3+
"@effect/experimental": patch
4+
"@effect/typeclass": patch
5+
"@effect/platform": patch
6+
"@effect/printer": patch
7+
"effect": patch
8+
"@effect/sql-pg": patch
9+
"@effect/cli": patch
10+
"@effect/sql": patch
11+
---
12+
13+
Wrap JSDoc @example tags with a TypeScript fence, closes #4002

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,10 @@ Output:
110110

111111
Output:
112112

113-
```
113+
````
114114
*
115115
* @example
116+
* ```ts
116117
* import { Effect } from "effect"
117118
*
118119
* console.log(Effect.runSyncExit(Effect.succeed(1)))
@@ -122,8 +123,9 @@ Output:
122123
* // _tag: "Success",
123124
* // value: 1
124125
* // }
126+
* ```
125127
*
126-
```
128+
````
127129

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"@changesets/cli": "^2.27.7",
4747
"@edge-runtime/vm": "^4.0.0",
4848
"@effect/build-utils": "^0.7.7",
49-
"@effect/docgen": "^0.4.4",
49+
"@effect/docgen": "^0.5.1",
5050
"@effect/dtslint": "^0.1.2",
5151
"@effect/eslint-plugin": "^0.2.0",
5252
"@effect/language-service": "^0.1.0",

packages/cli/src/Options.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,14 @@ export const boolean: (name: string, options?: Options.BooleanOptionsConfig) =>
154154
* inputs. The input will be mapped to it's associated value during parsing.
155155
*
156156
* @example
157+
* ```ts
157158
* import * as Options from "@effect/cli/Options"
158159
*
159160
* export const animal: Options.Options<"dog" | "cat"> = Options.choice(
160161
* "animal",
161162
* ["dog", "cat"]
162163
* )
164+
* ```
163165
*
164166
* @since 1.0.0
165167
* @category constructors
@@ -174,6 +176,7 @@ export const choice: <A extends string, C extends ReadonlyArray<A>>(
174176
* inputs. The input will be mapped to it's associated value during parsing.
175177
*
176178
* @example
179+
* ```ts
177180
* import * as Options from "@effect/cli/Options"
178181
* import * as Data from "effect/Data"
179182
*
@@ -195,6 +198,7 @@ export const choice: <A extends string, C extends ReadonlyArray<A>>(
195198
* ["dog", Dog()],
196199
* ["cat", Cat()],
197200
* ])
201+
* ```
198202
*
199203
* @since 1.0.0
200204
* @category constructors

packages/cli/src/Prompt.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,7 @@ export declare namespace All {
517517
* as an argument.
518518
*
519519
* @example
520+
* ```ts
520521
* import * as Prompt from "@effect/cli/Prompt"
521522
* import * as NodeContext from "@effect/platform-node/NodeContext"
522523
* import * as Runtime from "@effect/platform-node/NodeRuntime"
@@ -537,6 +538,7 @@ export declare namespace All {
537538
* const allWithTuple = Prompt.all([username, password])
538539
*
539540
* const allWithRecord = Prompt.all({ username, password })
541+
* ```
540542
*
541543
* @since 1.0.0
542544
* @category collecting & elements

0 commit comments

Comments
 (0)