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
26 changes: 26 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,29 @@ jobs:
node-version: ${{ matrix.node-version }}
- run: yarn install
- run: yarn ci

storybook-9-compatibility:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Use Node.js 20
uses: actions/setup-node@v1
with:
node-version: 20.x
- run: yarn install
- name: Install Storybook 9
run: >
yarn up
"@storybook/react@^9.0.0"
"@storybook/react-vite@^9.0.0"
"@storybook/addon-vitest@^9.0.0"
"storybook@^9.0.0"
- run: yarn workspace @nova/examples generate
- run: yarn workspace @nova/react-test-utils types
- run: yarn workspace @nova/react-test-utils test
- run: yarn workspace @nova/examples types
- run: yarn workspace @nova/examples test
- run: yarn workspace @nova/examples build-storybook
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "Update examples to Storybook 10",
"packageName": "@nova/examples",
"email": "stwilczy@microsoft.com",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "Support both Storybook 9 and Storybook 10",
"packageName": "@nova/react-test-utils",
"email": "stwilczy@microsoft.com",
"dependentChangeType": "patch"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"prettier-plugin-packagejson": "^2.5.0"
},
"engines": {
"node": ">=20.11.0",
"node": "^20.19.0 || >=22.12.0",
"yarn": ">=4.0.0"
}
}
14 changes: 4 additions & 10 deletions packages/examples/.storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import { dirname, join } from "path";
import type { StorybookConfig } from "@storybook/react-vite";
import { mergeConfig } from "vite";
import { plugins } from "../vitest.plugins";
import { plugins } from "../vitest.plugins.ts";

const config: StorybookConfig = {
stories: ["../src/**/*.stories.@(ts|tsx)"],
addons: [
getAbsolutePath("@storybook/addon-vitest"),
],
addons: ["@storybook/addon-vitest"],
framework: {
name: getAbsolutePath("@storybook/react-vite"),
name: "@storybook/react-vite",
options: {
strictMode: true,
},
Expand All @@ -23,7 +21,3 @@ const config: StorybookConfig = {
},
};
export default config;

function getAbsolutePath(value: string): string {
return dirname(require.resolve(join(value, "package.json")));
}
6 changes: 3 additions & 3 deletions packages/examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
"@graphql-codegen/cli": "^3.2.2",
"@graphql-codegen/typescript": "^3.0.2",
"@graphql-codegen/typescript-resolvers": "^3.1.1",
"@storybook/addon-vitest": "^9.0.15",
"@storybook/react-vite": "^9.0.15",
"@storybook/addon-vitest": "^10.0.0",
"@storybook/react-vite": "^10.0.0",
"@swc/core": "^1.11.0",
"@swc/plugin-relay": "^7.0.0",
"@types/react": "^18.3.1",
Expand All @@ -55,7 +55,7 @@
"playwright": "^1.51.1",
"relay-compiler": "^20.0.0",
"relay-test-utils": "^20.0.0",
"storybook": "^9.0.15",
"storybook": "^10.0.0",
"typescript": "^5.8.0",
"vite": "^6.3.0",
"vite-plugin-graphql-loader": "^4.0.0",
Expand Down
2 changes: 2 additions & 0 deletions packages/nova-react-test-utils/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ The `environment.eventing.bubble` is simple `jest.fn()` so you can assert on it.
Similarly to unit tests this package provides decorators for storybook stories using
either Apollo or Relay. The package exposes two implementation of same `getNovaDecorator` one for Relay and one for Apollo. One should be picked based on whether or not the component is using Apollo or Relay as GraphQL client.

The Storybook integrations support Storybook 9 and Storybook 10.

```tsx
import type { Meta, StoryObj } from "@storybook/react";
import type {
Expand Down
8 changes: 4 additions & 4 deletions packages/nova-react-test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"@apollo/client": "^3.4.15",
"@graphitation/apollo-mock-client": "^0.13.0",
"@graphitation/apollo-react-relay-duct-tape": "^1.3.0",
"@storybook/react": "^9.0.15",
"@storybook/react": "^10.0.0",
"@types/react-relay": "^18.0.0",
"@types/relay-test-utils": "^19.0.0",
"@vitest/browser": "^3.2.4",
Expand All @@ -55,22 +55,22 @@
"react-relay": "^20.0.0",
"relay-runtime": "^20.0.0",
"relay-test-utils": "^20.0.0",
"storybook": "^9.0.15",
"storybook": "^10.0.0",
"vitest": "^3.2.4",
"vitest-browser-react": "^1.0.0"
},
"peerDependencies": {
"@apollo/client": "^3.4",
"@graphitation/apollo-mock-client": "^0.13.0",
"@graphitation/apollo-react-relay-duct-tape": "^1.3.0",
"@storybook/react": "^9.0.0",
"@storybook/react": "^9.0.0 || ^10.0.0",
"@types/react-relay": ">=18",
"@types/relay-test-utils": ">=19",
"react": "^17 || ^18",
"react-relay": ">=19",
"relay-runtime": ">=19",
"relay-test-utils": ">=19",
"storybook": "^9.0.0"
"storybook": "^9.0.0 || ^10.0.0"
},
"peerDependenciesMeta": {
"@apollo/client": {
Expand Down
Loading
Loading