Skip to content

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Jun 10, 2025

This is an automated pull request that bumps the version from 9.1.0-alpha.3 to 9.1.0-alpha.4.
Once this pull request is merged, it will trigger a new release of version 9.1.0-alpha.4.
If you're not a core maintainer with permissions to release you can ignore this pull request.

To do

Before merging the PR, there are a few QA steps to go through:

  • Add the "freeze" label to this PR, to ensure it doesn't get automatically forced pushed by new changes.
  • Add the "ci:daily" label to this PR, to trigger the full test suite to run on this PR.

And for each change below:

  1. Ensure the change is appropriate for the version bump. E.g. patch release should only contain patches, not new or de-stabilizing features. If a change is not appropriate, revert the PR.
  2. Ensure the PR is labeled correctly with one of: "BREAKING CHANGE", "feature request", "bug", "maintenance", "dependencies", "documentation", "build", "unknown".
  3. Ensure the PR title is correct, and follows the format "[Area]: [Summary]", e.g. "React: Fix hooks in CSF3 render functions". If it is not correct, change the title in the PR.
    • Areas include: React, Vue, Core, Docs, Controls, etc.
    • First word of summary indicates the type: “Add”, “Fix”, “Upgrade”, etc.
    • The entire title should fit on a line

This is a list of all the PRs merged and commits pushed directly to next, that will be part of this release:

  • ✨ Feature Request: CSF Factories: Add parameters/globals types, extend API, portable stories #30601
  • 📝 Documentation: Docs: Point CSF Factories docs at RFC #31713 (will also be patched)

If you've made any changes doing the above QA (change PR titles, revert PRs), manually trigger a re-generation of this PR with this workflow and wait for it to finish. It will wipe your progress in this to do, which is expected.

Feel free to manually commit any changes necessary to this branch after you've done the last re-generation, following the Make Manual Changes section in the docs, especially if you're making changes to the changelog.

When everything above is done:


Generated changelog

9.1.0-alpha.4

  • CSF Factories: Add parameters/globals types, extend API, portable stories - #30601, thanks @kasperpeulen!

Greptile Summary

Introduces CSF (Component Story Format) Factories with significant type system improvements and story composition features.

  • Replaced definePreview with type-safe definePreviewAddon across all core addons for better TypeScript inference
  • Added new TypeScript parameter/globals type system for standardized addon configuration
  • Introduced .extend API enabling story composition and inheritance
  • Added configDir parameter to addon synchronization for improved path resolution
  • Simplified documentation by pointing users to RFC during experimental phase

# Conflicts:
#	code/core/src/csf/csf-factories.ts
# Conflicts:
#	code/addons/a11y/src/index.ts
#	code/addons/a11y/src/types.ts
#	code/addons/actions/src/index.ts
#	code/addons/backgrounds/src/index.ts
#	code/addons/controls/src/index.ts
#	code/addons/docs/src/index.ts
#	code/addons/essentials/src/index.ts
#	code/addons/essentials/src/types.ts
#	code/addons/highlight/src/index.ts
#	code/addons/highlight/src/types.ts
#	code/addons/interactions/src/types.ts
#	code/addons/links/src/index.ts
#	code/addons/measure/src/index.ts
#	code/addons/outline/src/index.ts
#	code/addons/pseudo-states/src/index.ts
#	code/addons/test/src/index.ts
#	code/addons/test/src/types.ts
#	code/addons/themes/src/index.ts
#	code/addons/viewport/src/index.ts
#	code/core/src/backgrounds/types.ts
#	code/core/src/csf/csf-factories.ts
#	code/core/src/viewport/types.ts
#	code/frameworks/nextjs-vite/src/index.ts
#	code/frameworks/nextjs/src/index.ts
#	code/renderers/react/src/csf-factories.test.tsx
#	code/renderers/react/src/preview.tsx
# Conflicts:
#	code/addons/vitest/src/types.ts
@github-actions github-actions bot added the release For PRs that trigger new releases. Automated label Jun 10, 2025
@github-actions github-actions bot added the release For PRs that trigger new releases. Automated label Jun 10, 2025
@kasperpeulen kasperpeulen merged commit 19614aa into next-release Jun 10, 2025
@kasperpeulen kasperpeulen deleted the version-non-patch-from-9.1.0-alpha.3 branch June 10, 2025 10:00
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

80 files reviewed, 8 comments
Edit PR Review Bot Settings | Greptile

const docsContext = this.docsContext(renderStoryToElement);

const { docs } = this.store.projectAnnotations.parameters || {};
const { docs } = this.store.projectAnnotations.parameters ?? ({} as { docs: any });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Type assertion to { docs: any } is overly permissive and could hide legitimate type errors. Consider using a more specific type or handling undefined explicitly.

export function definePreview<Addons extends PreviewAddon<never>[]>(
preview: { addons?: Addons } & ProjectAnnotations<ReactTypes & NextJsTypes & InferTypes<Addons>>
): NextPreview<InferTypes<Addons>> {
// @ts-expect-error hard
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: The // @ts-expect-error hard comment should be more descriptive about what type error is being suppressed and why it's necessary

Comment on lines 13 to 14
// @ts-expect-error (double exports)
export * from './portable-stories';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Consider moving portable-stories export to a separate entry point to avoid the double export ts-expect-error

export interface ReactStory extends Story<ReactRenderer> {}
export interface ReactStory<T extends ReactTypes, TInput extends StoryAnnotations<T, T['args']>>
extends Story<T, TInput> {
Component: ComponentType<Partial<T['args']>>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Consider making Component readonly to prevent accidental overwrites

id: k,
title: value.name,
icon: iconsMap[value.type],
icon: iconsMap[value.type!],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Type assertion unnecessary here - consider making viewport.type non-optional or handling undefined case explicitly

Comment on lines +180 to +182
get play() {
return input.play ?? meta.input?.play ?? (async () => {});
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Default empty async function should be defined as constant to avoid recreating on each get.

Comment on lines +7 to +16
import {
CSF2StoryWithLocale,
CSF3Button,
CSF3ButtonWithRender,
CSF3InputFieldFilled,
CSF3Primary,
MountInPlayFunction,
MountInPlayFunctionThrow,
} from './Button.csf4.stories';
import { CSF2Secondary, HooksStory } from './Button.csf4.stories';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Consider consolidating the two imports from Button.csf4.stories into a single import statement for better maintainability

Suggested change
import {
CSF2StoryWithLocale,
CSF3Button,
CSF3ButtonWithRender,
CSF3InputFieldFilled,
CSF3Primary,
MountInPlayFunction,
MountInPlayFunctionThrow,
} from './Button.csf4.stories';
import { CSF2Secondary, HooksStory } from './Button.csf4.stories';
import {
CSF2StoryWithLocale,
CSF3Button,
CSF3ButtonWithRender,
CSF3InputFieldFilled,
CSF3Primary,
MountInPlayFunction,
MountInPlayFunctionThrow,
CSF2Secondary,
HooksStory,
} from './Button.csf4.stories';

previewConfigPath: string,
configDir: string
) {
const previewConfig = await readConfig(previewConfigPath!);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Unnecessary non-null assertion operator - previewConfigPath is already required by function signature

Suggested change
const previewConfig = await readConfig(previewConfigPath!);
const previewConfig = await readConfig(previewConfigPath);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release For PRs that trigger new releases. Automated

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants