Skip to content

Commit

Permalink
Merge pull request #27381 from storybookjs/version-patch-from-8.1.4
Browse files Browse the repository at this point in the history
Release: Patch 8.1.5
  • Loading branch information
shilman authored May 30, 2024
2 parents d972793 + 47e24f0 commit d13fce1
Show file tree
Hide file tree
Showing 34 changed files with 130 additions and 150 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 8.1.5

- CSF-Tools: Fix export specifier bug - [#27418](https://github.com/storybookjs/storybook/pull/27418), thanks @valentinpalkovic!
- Dependency: Upgrade tempy - [#27366](https://github.com/storybookjs/storybook/pull/27366), thanks @mnigh!
- Tags: Refine composition behavior - [#27379](https://github.com/storybookjs/storybook/pull/27379), thanks @shilman!
- Theming: Fix self-referencing type - [#27155](https://github.com/storybookjs/storybook/pull/27155), thanks @SimenB!

## 8.1.4

- Angular: Revert style adjustments - [#27361](https://github.com/storybookjs/storybook/pull/27361), thanks @valentinpalkovic!
Expand Down
2 changes: 1 addition & 1 deletion code/lib/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"read-pkg-up": "^7.0.1",
"semver": "^7.3.7",
"strip-json-comments": "^3.0.1",
"tempy": "^1.0.1",
"tempy": "^3.1.0",
"tiny-invariant": "^1.3.1",
"ts-dedent": "^2.0.0"
},
Expand Down
8 changes: 4 additions & 4 deletions code/lib/cli/src/automigrate/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import prompts from 'prompts';
import chalk from 'chalk';
import boxen from 'boxen';
import { createWriteStream, move, remove } from 'fs-extra';
import tempy from 'tempy';
import { join } from 'path';
import invariant from 'tiny-invariant';
import semver from 'semver';
Expand Down Expand Up @@ -40,8 +39,9 @@ let TEMP_LOG_FILE_PATH = '';
const originalStdOutWrite = process.stdout.write.bind(process.stdout);
const originalStdErrWrite = process.stderr.write.bind(process.stdout);

const augmentLogsToFile = () => {
TEMP_LOG_FILE_PATH = tempy.file({ name: LOG_FILE_NAME });
const augmentLogsToFile = async () => {
const { temporaryFile } = await import('tempy');
TEMP_LOG_FILE_PATH = temporaryFile({ name: LOG_FILE_NAME });
const logStream = createWriteStream(TEMP_LOG_FILE_PATH);

process.stdout.write = (d: string) => {
Expand Down Expand Up @@ -158,7 +158,7 @@ export const automigrate = async ({
return null;
}

augmentLogsToFile();
await augmentLogsToFile();

logger.info('🔎 checking possible migrations..');

Expand Down
4 changes: 2 additions & 2 deletions code/lib/cli/src/dirs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { dirname, join } from 'path';

import downloadTarball from '@ndelangen/get-tarball';
import getNpmTarballUrl from 'get-npm-tarball-url';
import * as tempy from 'tempy';

import invariant from 'tiny-invariant';
import { externalFrameworks } from './project_types';
Expand All @@ -16,7 +15,8 @@ export function getCliDir() {
}

const resolveUsingBranchInstall = async (packageManager: JsPackageManager, request: string) => {
const tempDirectory = tempy.directory();
const { temporaryDirectory } = await import('tempy');
const tempDirectory = temporaryDirectory();
const name = request as keyof typeof versions;

// FIXME: this might not be the right version for community packages
Expand Down
8 changes: 4 additions & 4 deletions code/lib/cli/src/doctor/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import chalk from 'chalk';
import boxen from 'boxen';
import { createWriteStream, move, remove } from 'fs-extra';
import tempy from 'tempy';
import dedent from 'ts-dedent';
import { join } from 'path';

Expand All @@ -24,8 +23,9 @@ let TEMP_LOG_FILE_PATH = '';
const originalStdOutWrite = process.stdout.write.bind(process.stdout);
const originalStdErrWrite = process.stderr.write.bind(process.stdout);

const augmentLogsToFile = () => {
TEMP_LOG_FILE_PATH = tempy.file({ name: LOG_FILE_NAME });
const augmentLogsToFile = async () => {
const { temporaryFile } = await import('tempy');
TEMP_LOG_FILE_PATH = temporaryFile({ name: LOG_FILE_NAME });
const logStream = createWriteStream(TEMP_LOG_FILE_PATH);

process.stdout.write = (d: string) => {
Expand All @@ -51,7 +51,7 @@ export const doctor = async ({
configDir: userSpecifiedConfigDir,
packageManager: pkgMgr,
}: DoctorOptions = {}) => {
augmentLogsToFile();
await augmentLogsToFile();

let foundIssues = false;
const logDiagnostic = (title: string, message: string) => {
Expand Down
2 changes: 1 addition & 1 deletion code/lib/core-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"pretty-hrtime": "^1.0.3",
"resolve-from": "^5.0.0",
"semver": "^7.3.7",
"tempy": "^1.0.1",
"tempy": "^3.1.0",
"tiny-invariant": "^1.3.1",
"ts-dedent": "^2.0.0",
"util": "^0.12.4"
Expand Down
4 changes: 2 additions & 2 deletions code/lib/core-common/src/utils/cli.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { WriteStream } from 'fs-extra';
import { move, remove, writeFile, readFile, createWriteStream } from 'fs-extra';
import { join } from 'path';
import tempy from 'tempy';
import { rendererPackages } from './get-storybook-info';
import type { JsPackageManager } from '../js-package-manager';
import versions from '../versions';
Expand Down Expand Up @@ -86,7 +85,8 @@ export const createLogStream = async (
logStream: WriteStream;
}> => {
const finalLogPath = join(process.cwd(), logFileName);
const temporaryLogPath = tempy.file({ name: logFileName });
const { temporaryFile } = await import('tempy');
const temporaryLogPath = temporaryFile({ name: logFileName });

const logStream = createWriteStream(temporaryLogPath, { encoding: 'utf8' });

Expand Down
13 changes: 12 additions & 1 deletion code/lib/csf-tools/src/ConfigFile.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ describe('ConfigFile', () => {
)
).toEqual([{ directory: '../src', titlePrefix: 'Demo' }]);
});
it('export specfier', () => {
it('export specifier', () => {
expect(
getField(
['foo'],
Expand All @@ -227,6 +227,17 @@ describe('ConfigFile', () => {
)
).toEqual('bar');
});
it('export aliased specifier', () => {
expect(
getField(
['fooAlias'],
dedent`
const foo = 'bar';
export { foo as fooAlias };
`
)
).toEqual('bar');
});
});
});

Expand Down
9 changes: 7 additions & 2 deletions code/lib/csf-tools/src/ConfigFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,14 @@ export class ConfigFile {
} else if (node.specifiers) {
// export { X };
node.specifiers.forEach((spec) => {
if (t.isExportSpecifier(spec) && t.isIdentifier(spec.exported)) {
if (
t.isExportSpecifier(spec) &&
t.isIdentifier(spec.local) &&
t.isIdentifier(spec.exported)
) {
const { name: localName } = spec.local;
const { name: exportName } = spec.exported;
const decl = _findVarDeclarator(exportName, parent as t.Program) as any;
const decl = _findVarDeclarator(localName, parent as t.Program) as any;
self._exports[exportName] = decl.init;
self._exportDecls[exportName] = decl;
}
Expand Down
2 changes: 1 addition & 1 deletion code/lib/manager-api/src/lib/stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export const transformStoryIndexV4toV5 = (
(acc, entry) => {
acc[entry.id] = {
...entry,
tags: entry.tags ? [...entry.tags, 'dev'] : ['dev'],
tags: entry.tags ? ['dev', 'test', ...entry.tags] : ['dev'],
};

return acc;
Expand Down
4 changes: 2 additions & 2 deletions code/lib/theming/src/emotionAugmentation.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
import '@emotion/react';

declare module '@emotion/react' {
type StorybookTheme = import('./types').StorybookTheme;
export interface Theme extends StorybookTheme {}
type StorybookThemeInterface = import('./types').StorybookTheme;
export interface Theme extends StorybookThemeInterface {}
}
3 changes: 2 additions & 1 deletion code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -299,5 +299,6 @@
"Dependency Upgrades"
]
]
}
},
"deferredNextVersion": "8.1.5"
}
74 changes: 26 additions & 48 deletions code/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5796,7 +5796,7 @@ __metadata:
slash: "npm:^5.0.0"
strip-ansi: "npm:^7.1.0"
strip-json-comments: "npm:^3.1.1"
tempy: "npm:^1.0.1"
tempy: "npm:^3.1.0"
tiny-invariant: "npm:^1.3.1"
ts-dedent: "npm:^2.0.0"
typescript: "npm:^5.3.2"
Expand Down Expand Up @@ -5925,7 +5925,7 @@ __metadata:
resolve-from: "npm:^5.0.0"
semver: "npm:^7.3.7"
slash: "npm:^5.0.0"
tempy: "npm:^1.0.1"
tempy: "npm:^3.1.0"
tiny-invariant: "npm:^1.3.1"
ts-dedent: "npm:^2.0.0"
type-fest: "npm:~2.19"
Expand Down Expand Up @@ -12655,10 +12655,12 @@ __metadata:
languageName: node
linkType: hard

"crypto-random-string@npm:^2.0.0":
version: 2.0.0
resolution: "crypto-random-string@npm:2.0.0"
checksum: 10c0/288589b2484fe787f9e146f56c4be90b940018f17af1b152e4dde12309042ff5a2bf69e949aab8b8ac253948381529cc6f3e5a2427b73643a71ff177fa122b37
"crypto-random-string@npm:^4.0.0":
version: 4.0.0
resolution: "crypto-random-string@npm:4.0.0"
dependencies:
type-fest: "npm:^1.0.1"
checksum: 10c0/16e11a3c8140398f5408b7fded35a961b9423c5dac39a60cbbd08bd3f0e07d7de130e87262adea7db03ec1a7a4b7551054e0db07ee5408b012bac5400cfc07a5
languageName: node
linkType: hard

Expand Down Expand Up @@ -13143,22 +13145,6 @@ __metadata:
languageName: node
linkType: hard

"del@npm:^6.0.0":
version: 6.1.1
resolution: "del@npm:6.1.1"
dependencies:
globby: "npm:^11.0.1"
graceful-fs: "npm:^4.2.4"
is-glob: "npm:^4.0.1"
is-path-cwd: "npm:^2.2.0"
is-path-inside: "npm:^3.0.2"
p-map: "npm:^4.0.0"
rimraf: "npm:^3.0.2"
slash: "npm:^3.0.0"
checksum: 10c0/8a095c5ccade42c867a60252914ae485ec90da243d735d1f63ec1e64c1cfbc2b8810ad69a29ab6326d159d4fddaa2f5bad067808c42072351ec458efff86708f
languageName: node
linkType: hard

"delay@npm:^5.0.0":
version: 5.0.0
resolution: "delay@npm:5.0.0"
Expand Down Expand Up @@ -16388,7 +16374,7 @@ __metadata:
languageName: node
linkType: hard

"globby@npm:^11.0.1, globby@npm:^11.1.0":
"globby@npm:^11.1.0":
version: 11.1.0
resolution: "globby@npm:11.1.0"
dependencies:
Expand Down Expand Up @@ -17987,13 +17973,6 @@ __metadata:
languageName: node
linkType: hard

"is-path-cwd@npm:^2.2.0":
version: 2.2.0
resolution: "is-path-cwd@npm:2.2.0"
checksum: 10c0/afce71533a427a759cd0329301c18950333d7589533c2c90205bd3fdcf7b91eb92d1940493190567a433134d2128ec9325de2fd281e05be1920fbee9edd22e0a
languageName: node
linkType: hard

"is-path-inside@npm:^3.0.2, is-path-inside@npm:^3.0.3":
version: 3.0.3
resolution: "is-path-inside@npm:3.0.3"
Expand Down Expand Up @@ -27245,10 +27224,10 @@ __metadata:
languageName: node
linkType: hard

"temp-dir@npm:^2.0.0":
version: 2.0.0
resolution: "temp-dir@npm:2.0.0"
checksum: 10c0/b1df969e3f3f7903f3426861887ed76ba3b495f63f6d0c8e1ce22588679d9384d336df6064210fda14e640ed422e2a17d5c40d901f60e161c99482d723f4d309
"temp-dir@npm:^3.0.0":
version: 3.0.0
resolution: "temp-dir@npm:3.0.0"
checksum: 10c0/a86978a400984cd5f315b77ebf3fe53bb58c61f192278cafcb1f3fb32d584a21dc8e08b93171d7874b7cc972234d3455c467306cc1bfc4524b622e5ad3bfd671
languageName: node
linkType: hard

Expand All @@ -27261,16 +27240,15 @@ __metadata:
languageName: node
linkType: hard

"tempy@npm:^1.0.1":
version: 1.0.1
resolution: "tempy@npm:1.0.1"
"tempy@npm:^3.1.0":
version: 3.1.0
resolution: "tempy@npm:3.1.0"
dependencies:
del: "npm:^6.0.0"
is-stream: "npm:^2.0.0"
temp-dir: "npm:^2.0.0"
type-fest: "npm:^0.16.0"
unique-string: "npm:^2.0.0"
checksum: 10c0/864a1cf1b5536dc21e84ae45dbbc3ba4dd2c7ec1674d895f99c349cf209df959a53d797ca38d0b2cf69c7684d565fde5cfc67faaa63b7208ffb21d454b957472
is-stream: "npm:^3.0.0"
temp-dir: "npm:^3.0.0"
type-fest: "npm:^2.12.2"
unique-string: "npm:^3.0.0"
checksum: 10c0/b88e70baa8d935ba8f0e0372b59ad1a961121f098da5fb4a6e05bec98ec32a49026b553532fb75c1c102ec782fd4c6a6bde0d46cbe87013fa324451ce476fb76
languageName: node
linkType: hard

Expand Down Expand Up @@ -28236,12 +28214,12 @@ __metadata:
languageName: node
linkType: hard

"unique-string@npm:^2.0.0":
version: 2.0.0
resolution: "unique-string@npm:2.0.0"
"unique-string@npm:^3.0.0":
version: 3.0.0
resolution: "unique-string@npm:3.0.0"
dependencies:
crypto-random-string: "npm:^2.0.0"
checksum: 10c0/11820db0a4ba069d174bedfa96c588fc2c96b083066fafa186851e563951d0de78181ac79c744c1ed28b51f9d82ac5b8196ff3e4560d0178046ef455d8c2244b
crypto-random-string: "npm:^4.0.0"
checksum: 10c0/b35ea034b161b2a573666ec16c93076b4b6106b8b16c2415808d747ab3a0566b5db0c4be231d4b11cfbc16d7fd915c9d8a45884bff0e2db11b799775b2e1e017
languageName: node
linkType: hard

Expand Down
Binary file modified docs/api/story-pipeline-playwright-ct.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/api/story-pipeline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/snippets/angular/tags-combo-example.ts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ type Story = StoryObj<Button>;

export const Variant1: Story = {
// 👇 This story will not appear in Storybook's sidebar or docs page
tags: ['!dev', '!docs'],
tags: ['!dev', '!autodocs'],
args: { variant: 1 },
};

export const Variant2: Story = {
// 👇 This story will not appear in Storybook's sidebar or docs page
tags: ['!dev', '!docs'],
tags: ['!dev', '!autodocs'],
args: { variant: 2 },
};

Expand Down
4 changes: 2 additions & 2 deletions docs/snippets/react/tags-combo-example.js.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ export default {

export const Variant1 = {
// 👇 This story will not appear in Storybook's sidebar or docs page
tags: ['!dev', '!docs'],
tags: ['!dev', '!autodocs'],
args: { variant: 1 },
};

export const Variant2 = {
// 👇 This story will not appear in Storybook's sidebar or docs page
tags: ['!dev', '!docs'],
tags: ['!dev', '!autodocs'],
args: { variant: 2 },
};

Expand Down
4 changes: 2 additions & 2 deletions docs/snippets/react/tags-combo-example.ts-4-9.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ type Story = StoryObj<typeof meta>;

export const Variant1: Story = {
// 👇 This story will not appear in Storybook's sidebar or docs page
tags: ['!dev', '!docs'],
tags: ['!dev', '!autodocs'],
args: { variant: 1 },
};

export const Variant2: Story = {
// 👇 This story will not appear in Storybook's sidebar or docs page
tags: ['!dev', '!docs'],
tags: ['!dev', '!autodocs'],
args: { variant: 2 },
};

Expand Down
4 changes: 2 additions & 2 deletions docs/snippets/react/tags-combo-example.ts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ type Story = StoryObj<typeof Button>;

export const Variant1: Story = {
// 👇 This story will not appear in Storybook's sidebar or docs page
tags: ['!dev', '!docs'],
tags: ['!dev', '!autodocs'],
args: { variant: 1 },
};

export const Variant2: Story = {
// 👇 This story will not appear in Storybook's sidebar or docs page
tags: ['!dev', '!docs'],
tags: ['!dev', '!autodocs'],
args: { variant: 2 },
};

Expand Down
Loading

0 comments on commit d13fce1

Please sign in to comment.