Skip to content

Commit 0955542

Browse files
committed
fix docs ci checks
1 parent a9b042a commit 0955542

8 files changed

Lines changed: 48 additions & 44 deletions

File tree

docs/snippets/sdk/quickstart/add-source.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
{/*
2-
This file is generated by scripts/generate-doc-snippets.ts.
3-
Edit examples/docs-sdk-quickstart/src/main.ts between the docs:start/docs:end markers instead.
4-
*/}
1+
{/_
2+
This file is generated by scripts/generate-doc-snippets.ts.
3+
Edit examples/docs-sdk-quickstart/src/main.ts between the docs:start/docs:end markers instead.
4+
_/}
55

66
```ts
77
await executor.openapi.addSpec({

docs/snippets/sdk/quickstart/close-executor.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
{/*
2-
This file is generated by scripts/generate-doc-snippets.ts.
3-
Edit examples/docs-sdk-quickstart/src/main.ts between the docs:start/docs:end markers instead.
4-
*/}
1+
{/_
2+
This file is generated by scripts/generate-doc-snippets.ts.
3+
Edit examples/docs-sdk-quickstart/src/main.ts between the docs:start/docs:end markers instead.
4+
_/}
55

66
```ts
77
await executor.close();

docs/snippets/sdk/quickstart/create-executor.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
{/*
2-
This file is generated by scripts/generate-doc-snippets.ts.
3-
Edit examples/docs-sdk-quickstart/src/main.ts between the docs:start/docs:end markers instead.
4-
*/}
1+
{/_
2+
This file is generated by scripts/generate-doc-snippets.ts.
3+
Edit examples/docs-sdk-quickstart/src/main.ts between the docs:start/docs:end markers instead.
4+
_/}
55

66
```ts
77
const executor = await createExecutor({

docs/snippets/sdk/quickstart/inspect-schema.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
{/*
2-
This file is generated by scripts/generate-doc-snippets.ts.
3-
Edit examples/docs-sdk-quickstart/src/main.ts between the docs:start/docs:end markers instead.
4-
*/}
1+
{/_
2+
This file is generated by scripts/generate-doc-snippets.ts.
3+
Edit examples/docs-sdk-quickstart/src/main.ts between the docs:start/docs:end markers instead.
4+
_/}
55

66
```ts
77
const schema = await executor.tools.schema("inventory.listItems");

docs/snippets/sdk/quickstart/list-tools.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
{/*
2-
This file is generated by scripts/generate-doc-snippets.ts.
3-
Edit examples/docs-sdk-quickstart/src/main.ts between the docs:start/docs:end markers instead.
4-
*/}
1+
{/_
2+
This file is generated by scripts/generate-doc-snippets.ts.
3+
Edit examples/docs-sdk-quickstart/src/main.ts between the docs:start/docs:end markers instead.
4+
_/}
55

66
```ts
77
const tools = await executor.tools.list({ sourceId: "inventory" });
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# @executor-js/example-docs-sdk-quickstart changelog
2+
3+
This file exists for `changesets/action@v1` compatibility (it reads every
4+
workspace package's `CHANGELOG.md` to build the Version Packages PR).
5+
Canonical user-facing release notes are at `apps/cli/release-notes/next.md`
6+
and on the GitHub Releases page.

examples/docs-sdk-quickstart/src/main.ts

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -77,30 +77,28 @@ const executor = await createExecutor({
7777
});
7878
// docs:end create-executor
7979

80-
try {
81-
// docs:start add-source
82-
await executor.openapi.addSpec({
83-
namespace: "inventory",
84-
scope: "docs-workspace",
85-
spec: JSON.stringify(inventoryApi),
86-
});
87-
// docs:end add-source
80+
// docs:start add-source
81+
await executor.openapi.addSpec({
82+
namespace: "inventory",
83+
scope: "docs-workspace",
84+
spec: JSON.stringify(inventoryApi),
85+
});
86+
// docs:end add-source
87+
88+
// docs:start list-tools
89+
const tools = await executor.tools.list({ sourceId: "inventory" });
8890

89-
// docs:start list-tools
90-
const tools = await executor.tools.list({ sourceId: "inventory" });
91+
for (const tool of tools) {
92+
console.log(`${tool.id}: ${tool.description}`);
93+
}
94+
// docs:end list-tools
9195

92-
for (const tool of tools) {
93-
console.log(`${tool.id}: ${tool.description}`);
94-
}
95-
// docs:end list-tools
96+
// docs:start inspect-schema
97+
const schema = await executor.tools.schema("inventory.listItems");
9698

97-
// docs:start inspect-schema
98-
const schema = await executor.tools.schema("inventory.listItems");
99+
console.log(schema?.inputTypeScript ?? "No input required");
100+
// docs:end inspect-schema
99101

100-
console.log(schema?.inputTypeScript ?? "No input required");
101-
// docs:end inspect-schema
102-
} finally {
103-
// docs:start close-executor
104-
await executor.close();
105-
// docs:end close-executor
106-
}
102+
// docs:start close-executor
103+
await executor.close();
104+
// docs:end close-executor

scripts/generate-doc-snippets.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ for (const source of sources) {
6464
await mkdir(dirname(output), { recursive: true });
6565
await writeFile(
6666
output,
67-
`{/*\n This file is generated by scripts/generate-doc-snippets.ts.\n Edit ${source.source} between the docs:start/docs:end markers instead.\n*/}\n\n\`\`\`${source.language}\n${dedent(lines)}\n\`\`\`\n`,
67+
`{/_\nThis file is generated by scripts/generate-doc-snippets.ts.\nEdit ${source.source} between the docs:start/docs:end markers instead.\n_/}\n\n\`\`\`${source.language}\n${dedent(lines)}\n\`\`\`\n`,
6868
);
6969
}
7070
}

0 commit comments

Comments
 (0)