Skip to content

Commit

Permalink
Merge branch 'addon-docs-without-react' into norbert/not-add-react-init
Browse files Browse the repository at this point in the history
  • Loading branch information
JReinhold authored Dec 18, 2023
2 parents a6958dd + 2db44d7 commit d17d493
Show file tree
Hide file tree
Showing 74 changed files with 1,073 additions and 2,719 deletions.
20 changes: 10 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -652,27 +652,27 @@ workflows:
requires:
- unit-tests
- create-sandboxes:
parallelism: 20
parallelism: 19
requires:
- build
- build-sandboxes:
parallelism: 20
parallelism: 19
requires:
- create-sandboxes
- chromatic-sandboxes:
parallelism: 17
parallelism: 16
requires:
- build-sandboxes
- e2e-production:
parallelism: 15
parallelism: 14
requires:
- build-sandboxes
- e2e-dev:
parallelism: 2
requires:
- create-sandboxes
- test-runner-production:
parallelism: 15
parallelism: 14
requires:
- build-sandboxes
- bench:
Expand Down Expand Up @@ -706,30 +706,30 @@ workflows:
requires:
- build
- create-sandboxes:
parallelism: 33
parallelism: 31
requires:
- build
# - smoke-test-sandboxes: # disabled for now
# requires:
# - create-sandboxes
- build-sandboxes:
parallelism: 33
parallelism: 31
requires:
- create-sandboxes
- chromatic-sandboxes:
parallelism: 30
parallelism: 28
requires:
- build-sandboxes
- e2e-production:
parallelism: 28
parallelism: 26
requires:
- build-sandboxes
- e2e-dev:
parallelism: 2
requires:
- create-sandboxes
- test-runner-production:
parallelism: 28
parallelism: 26
requires:
- build-sandboxes

Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 7.6.5

- Angular: Update Angular cli templates - [#25152](https://github.com/storybookjs/storybook/pull/25152), thanks [@Marklb](https://github.com/Marklb)!
- Blocks: Fix Subtitle block for unattached docs pages - [#25157](https://github.com/storybookjs/storybook/pull/25157), thanks [@kripod](https://github.com/kripod)!
- SvelteKit: Fix missing `$app` modules - [#25132](https://github.com/storybookjs/storybook/pull/25132), thanks [@paoloricciuti](https://github.com/paoloricciuti)!

## 7.6.4

- Angular: Fix CSF Plugin - [#25098](https://github.com/storybookjs/storybook/pull/25098), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)!
Expand Down
7 changes: 7 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- [Icons is deprecated](#icons-is-deprecated)
- [React-docgen component analysis by default](#react-docgen-component-analysis-by-default)
- [Removed postinstall](#removed-postinstall)
- [Removed stories.json](#removed-storiesjson)
- [Framework-specific changes](#framework-specific-changes)
- [Angular: Drop support for Angular \< 15](#angular-drop-support-for-angular--15)
- [Next.js: Drop support for version \< 13.5](#nextjs-drop-support-for-version--135)
Expand Down Expand Up @@ -473,6 +474,12 @@ For more information see: https://storybook.js.org/docs/react/api/main-config-ty

We removed the `@storybook/postinstall` package, which provided some utilities for addons to programmatically modify user configuration files on install. This package was years out of date, so this should be a non-disruptive change. If your addon used the package, you can view the old source code [here](https://github.com/storybookjs/storybook/tree/release-7-5/code/lib/postinstall) and adapt it into your addon.

#### Removed stories.json

In addition to the built storybook, `storybook build` generates two files, `index.json` and `stories.json`, that list out the contents of the Storybook. `stories.json` is a legacy format and we included it for backwards compatibility. As of 8.0 we no longer build `stories.json` by default, and we will remove it completely in 9.0.

In the meantime if you have code that relies on `stories.json`, you can find code that transforms the "v4" `index.json` to the "v3" `stories.json` format (and their respective TS types): https://github.com/storybookjs/storybook/blob/release-7-5/code/lib/core-server/src/utils/stories-json.ts#L71-L91

### Framework-specific changes

#### Angular: Drop support for Angular \< 15
Expand Down
1 change: 0 additions & 1 deletion code/addons/docs/src/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ export const viteFinal = async (config: any, options: Options) => {
enforce: 'pre',
config: () => ({
resolve: {
// TODO: does this work if pre-existing alias is an array?
alias: {
react,
'react-dom': reactDom,
Expand Down
8 changes: 4 additions & 4 deletions code/builders/builder-vite/src/optimizeDeps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ const INCLUDE_CANDIDATES = [
'prettier/parser-typescript',
'prop-types',
'qs',
// 'react-dom', // TODO: de we really need to disable these?
// 'react-dom/client',
'react-dom',
'react-dom/client',
'react-fast-compare',
'react-is',
'react-textarea-autosize',
// 'react',
// 'react/jsx-runtime',
'react',
'react/jsx-runtime',
'refractor/core',
'refractor/lang/bash.js',
'refractor/lang/css.js',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ export function mockSveltekitStores() {
config: () => ({
resolve: {
alias: {
$app: resolve(__dirname, '../src/mocks/app/'),
'$app/forms': resolve(__dirname, '../src/mocks/app/forms.ts'),
'$app/navigation': resolve(__dirname, '../src/mocks/app/navigation.ts'),
'$app/stores': resolve(__dirname, '../src/mocks/app/stores.ts'),
},
},
}),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<script>
import { browser, dev, building, version } from '$app/environment';
</script>

<div data-testid="browser">{browser}</div>
<div data-testid="dev">{dev}</div>
<div data-testid="building">{building}</div>
<div data-testid="version" data-chromatic="ignore">{version}</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<script>
import { assets, base } from "$app/paths";
</script>

<div data-testid="assets">{assets}</div>
<div data-testid="base">{base}</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { expect, fn, within } from '@storybook/test';
import Environment from './Environment.svelte';

export default {
title: 'stories/sveltekit/modules/environment',
component: Environment,
tags: ['autodocs'],
};

export const Default = {};
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { expect, fn, within } from '@storybook/test';
import Paths from './Paths.svelte';

export default {
title: 'stories/sveltekit/modules/paths',
component: Paths,
tags: ['autodocs'],
};

export const Default = {};
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<script>
import { browser, dev, building, version } from '$app/environment';
</script>

<div data-testid="browser">{browser}</div>
<div data-testid="dev">{dev}</div>
<div data-testid="building">{building}</div>
<div data-testid="version" data-chromatic="ignore">{version}</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<script>
import { assets, base } from "$app/paths";
</script>

<div data-testid="assets">{assets}</div>
<div data-testid="base">{base}</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { expect, fn, within } from '@storybook/test';
import Environment from './Environment.svelte';

export default {
title: 'stories/sveltekit/modules/environment',
component: Environment,
tags: ['autodocs'],
};

export const Default = {};
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { expect, fn, within } from '@storybook/test';
import Paths from './Paths.svelte';

export default {
title: 'stories/sveltekit/modules/paths',
component: Paths,
tags: ['autodocs'],
};

export const Default = {};
24 changes: 0 additions & 24 deletions code/lib/cli/src/sandbox-templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,28 +416,6 @@ const baseTemplates = {
// Remove smoke-test from the list once https://github.com/storybookjs/storybook/issues/19351 is fixed.
skipTasks: ['smoke-test', 'e2e-tests-dev', 'bench'],
},
'preact-webpack5/default-js': {
name: 'Preact CLI Latest (Webpack | JavaScript)',
script:
'npx preact-cli create default {{beforeDir}} --name preact-app --yarn --no-install && cd {{beforeDir}} && echo "module.exports = {}" > webpack.config.js',
expected: {
framework: '@storybook/preact-webpack5',
renderer: '@storybook/preact',
builder: '@storybook/builder-webpack5',
},
skipTasks: ['e2e-tests-dev', 'bench'],
},
'preact-webpack5/default-ts': {
name: 'Preact CLI Latest (Webpack | TypeScript)',
script:
'npx preact-cli create typescript {{beforeDir}} --name preact-app --yarn --no-install && cd {{beforeDir}} && echo "module.exports = {}" > webpack.config.js',
expected: {
framework: '@storybook/preact-webpack5',
renderer: '@storybook/preact',
builder: '@storybook/builder-webpack5',
},
skipTasks: ['e2e-tests-dev', 'bench'],
},
'preact-vite/default-js': {
name: 'Preact Latest (Vite | JavaScript)',
script: 'npm create vite --yes {{beforeDir}} -- --template preact',
Expand Down Expand Up @@ -618,7 +596,6 @@ export const merged: TemplateKey[] = [
'react-webpack/18-ts',
'react-webpack/17-ts',
'angular-cli/15-ts',
'preact-webpack5/default-ts',
'preact-vite/default-ts',
'html-webpack/default',
'html-vite/default-ts',
Expand All @@ -638,7 +615,6 @@ export const daily: TemplateKey[] = [
'nextjs/default-js',
'nextjs/prerelease',
'qwik-vite/default-ts',
'preact-webpack5/default-js',
'preact-vite/default-js',
'html-vite/default-js',
];
Expand Down
10 changes: 1 addition & 9 deletions code/lib/core-server/src/build-static.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
copyAllStaticFilesRelativeToMain,
} from './utils/copy-all-static-files';
import { getBuilders } from './utils/get-builders';
import { convertToIndexV3, extractStoriesJson } from './utils/stories-json';
import { extractStoriesJson } from './utils/stories-json';
import { extractStorybookMetadata } from './utils/metadata';
import { StoryIndexGenerator } from './utils/StoryIndexGenerator';
import { summarizeIndex } from './utils/summarizeIndex';
Expand Down Expand Up @@ -172,19 +172,11 @@ export async function buildStaticStandalone(options: BuildStaticStandaloneOption
storyIndexers: deprecatedStoryIndexers,
indexers,
docs: docsOptions,
storiesV2Compatibility: !features?.storyStoreV7,
storyStoreV7: !!features?.storyStoreV7,
build,
});

initializedStoryIndexGenerator = generator.initialize().then(() => generator);
effects.push(
extractStoriesJson(
join(options.outputDir, 'stories.json'),
initializedStoryIndexGenerator as Promise<StoryIndexGenerator>,
convertToIndexV3
)
);
effects.push(
extractStoriesJson(
join(options.outputDir, 'index.json'),
Expand Down
Loading

0 comments on commit d17d493

Please sign in to comment.