Repository navigation
Skills M2b: Rework the core toolsets into their intended shape #35726
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
ff60e57
Review 1/6 — the contract: the open-service README
kasperpeulen 5bc15c9
Review 2/6 — the construct: defineToolset, toolset types, the registr…
kasperpeulen 1b8f719
Review 3/6 — the tool surface: all four toolset definitions
kasperpeulen 539cf02
Review 4/6 — the docs access machinery
kasperpeulen 8f6b23f
Review 5/6 — wiring and build: the registration sites and the portabl…
kasperpeulen a5ab56c
Review 6/6 — the ported engine bodies and their tests
kasperpeulen 1f90471
Merge branch 'next' into m2b-core-toolsets
JReinhold File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| import { beforeEach, describe, expect, it } from 'vitest'; | ||
|
|
||
| import { clearToolsetRegistry, getToolset } from 'storybook/open-service'; | ||
| import type { Options } from 'storybook/internal/types'; | ||
|
|
||
| import { services } from './preset.ts'; | ||
|
|
||
| const options = { | ||
| channel: { on: () => {}, off: () => {}, emit: () => {} }, | ||
| presets: { | ||
| apply: async (key: string, fallback?: unknown) => | ||
| key === 'storyIndexGenerator' ? { getIndex: async () => ({ v: 5, entries: {} }) } : fallback, | ||
| }, | ||
| } as unknown as Options; | ||
|
|
||
| describe('services preset hook', () => { | ||
| beforeEach(() => { | ||
| clearToolsetRegistry(); | ||
| }); | ||
|
|
||
| // Consumers resolve the `test` toolset for its descriptions and schemas alone, without a dev | ||
| // server: `storybook ai` metadata generation applies `services` but never starts one, and a | ||
| // non-Vite dev server returns from `experimental_serverChannel` before it could register. Both | ||
| // used to hit an unregistered toolset and fail hard. | ||
| it('registers the test toolset without a server channel', async () => { | ||
| await services(undefined, options); | ||
|
|
||
| expect(getToolset('test').methods.run.description).toBeDefined(); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.