Skip to content

Commit d44ab3c

Browse files
authored
Merge pull request #29678 from storybookjs/version-non-patch-from-8.5.0-alpha.9
Release: Prerelease 8.5.0-alpha.10
2 parents c9f6fa2 + 0a91dc5 commit d44ab3c

File tree

13 files changed

+49
-27
lines changed

13 files changed

+49
-27
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## 8.4.5
2+
3+
- Angular: Support v19 - [#29659](https://github.com/storybookjs/storybook/pull/29659), thanks @leosvelperez!
4+
- CLI: Disable corepack auto pin behavior - [#29627](https://github.com/storybookjs/storybook/pull/29627), thanks @yannbf!
5+
- CLI: Fix qwik init - [#29632](https://github.com/storybookjs/storybook/pull/29632), thanks @shilman!
6+
- Nextjs-Vite: Add Next.js 15 support - [#29640](https://github.com/storybookjs/storybook/pull/29640), thanks @yannbf!
7+
18
## 8.4.4
29

310
- Addon Test: Only optimize react deps if applicable in vitest-plugin - [#29617](https://github.com/storybookjs/storybook/pull/29617), thanks @yannbf!

CHANGELOG.prerelease.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 8.5.0-alpha.10
2+
3+
- Addon Test: Use pathe for better windows support - [#29676](https://github.com/storybookjs/storybook/pull/29676), thanks @yannbf!
4+
- Angular: Default to standalone components in Angular v19 - [#29677](https://github.com/storybookjs/storybook/pull/29677), thanks @ingowagner!
5+
16
## 8.5.0-alpha.9
27

38
- Angular: Support v19 - [#29659](https://github.com/storybookjs/storybook/pull/29659), thanks @leosvelperez!

code/addons/test/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@
9898
"execa": "^8.0.1",
9999
"find-up": "^7.0.0",
100100
"formik": "^2.2.9",
101+
"pathe": "^1.1.2",
101102
"picocolors": "^1.1.0",
102103
"react": "^18.2.0",
103104
"react-dom": "^18.2.0",

code/addons/test/src/node/boot-test-runner.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { type ChildProcess } from 'node:child_process';
2-
import { join } from 'node:path';
32

43
import type { Channel } from 'storybook/internal/channels';
54
import {
@@ -13,6 +12,7 @@ import {
1312

1413
// eslint-disable-next-line depend/ban-dependencies
1514
import { execaNode } from 'execa';
15+
import { join } from 'pathe';
1616

1717
import { TEST_PROVIDER_ID } from '../constants';
1818
import { log } from '../logger';

code/addons/test/src/node/test-manager.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { createVitest } from 'vitest/node';
33

44
import { Channel, type ChannelTransport } from '@storybook/core/channels';
55

6-
import path from 'path';
6+
import path from 'pathe';
77

88
import { TEST_PROVIDER_ID } from '../constants';
99
import { TestManager } from './test-manager';

code/addons/test/src/node/vitest-manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { existsSync } from 'node:fs';
2-
import path, { normalize } from 'node:path';
32

43
import type { TestProject, TestSpecification, Vitest, WorkspaceProject } from 'vitest/node';
54

65
import type { Channel } from 'storybook/internal/channels';
76
import type { TestingModuleRunRequestPayload } from 'storybook/internal/core-events';
87

8+
import path, { normalize } from 'pathe';
99
import slash from 'slash';
1010

1111
import { log } from '../logger';

code/addons/test/src/postinstall.ts

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { existsSync } from 'node:fs';
22
import * as fs from 'node:fs/promises';
33
import { writeFile } from 'node:fs/promises';
4-
import { dirname, join, relative } from 'node:path';
5-
import * as path from 'node:path';
64

75
import {
86
JsPackageManagerFactory,
@@ -16,6 +14,7 @@ import { colors, logger } from 'storybook/internal/node-logger';
1614
// eslint-disable-next-line depend/ban-dependencies
1715
import { execa } from 'execa';
1816
import { findUp } from 'find-up';
17+
import { dirname, extname, join, relative, resolve } from 'pathe';
1918
import picocolors from 'picocolors';
2019
import prompts from 'prompts';
2120
import { coerce, satisfies } from 'semver';
@@ -27,7 +26,8 @@ import { printError, printInfo, printSuccess, step } from './postinstall-logger'
2726
const ADDON_NAME = '@storybook/experimental-addon-test' as const;
2827
const EXTENSIONS = ['.js', '.jsx', '.ts', '.tsx', '.cts', '.mts', '.cjs', '.mjs'] as const;
2928

30-
const findFile = async (basename: string) => findUp(EXTENSIONS.map((ext) => basename + ext));
29+
const findFile = async (basename: string, extraExtensions: string[] = []) =>
30+
findUp([...EXTENSIONS, ...extraExtensions].map((ext) => basename + ext));
3131

3232
export default async function postInstall(options: PostinstallOptions) {
3333
printSuccess(
@@ -244,7 +244,10 @@ export default async function postInstall(options: PostinstallOptions) {
244244
args: ['playwright', 'install', 'chromium', '--with-deps'],
245245
});
246246

247-
const vitestSetupFile = path.resolve(options.configDir, 'vitest.setup.ts');
247+
const fileExtension =
248+
allDeps['typescript'] || (await findFile('tsconfig', ['.json'])) ? 'ts' : 'js';
249+
250+
const vitestSetupFile = resolve(options.configDir, `vitest.setup.${fileExtension}`);
248251
if (existsSync(vitestSetupFile)) {
249252
printError(
250253
'🚨 Oh no!',
@@ -264,9 +267,9 @@ export default async function postInstall(options: PostinstallOptions) {
264267
logger.plain(`${step} Creating a Vitest setup file for Storybook:`);
265268
logger.plain(colors.gray(` ${vitestSetupFile}`));
266269

267-
const previewExists = EXTENSIONS.map((ext) =>
268-
path.resolve(options.configDir, `preview${ext}`)
269-
).some((config) => existsSync(config));
270+
const previewExists = EXTENSIONS.map((ext) => resolve(options.configDir, `preview${ext}`)).some(
271+
(config) => existsSync(config)
272+
);
270273

271274
await writeFile(
272275
vitestSetupFile,
@@ -331,10 +334,10 @@ export default async function postInstall(options: PostinstallOptions) {
331334

332335
if (rootConfig) {
333336
// If there's an existing config, we create a workspace file so we can run Storybook tests alongside.
334-
const extname = path.extname(rootConfig);
335-
const browserWorkspaceFile = path.resolve(dirname(rootConfig), `vitest.workspace${extname}`);
337+
const extension = extname(rootConfig);
338+
const browserWorkspaceFile = resolve(dirname(rootConfig), `vitest.workspace${extension}`);
336339
// to be set in vitest config
337-
const vitestSetupFilePath = path.relative(path.dirname(browserWorkspaceFile), vitestSetupFile);
340+
const vitestSetupFilePath = relative(dirname(browserWorkspaceFile), vitestSetupFile);
338341

339342
logger.line(1);
340343
logger.plain(`${step} Creating a Vitest project workspace file:`);
@@ -373,9 +376,9 @@ export default async function postInstall(options: PostinstallOptions) {
373376
);
374377
} else {
375378
// If there's no existing Vitest/Vite config, we create a new Vitest config file.
376-
const newVitestConfigFile = path.resolve('vitest.config.ts');
379+
const newVitestConfigFile = resolve(`vitest.config.${fileExtension}`);
377380
// to be set in vitest config
378-
const vitestSetupFilePath = path.relative(path.dirname(newVitestConfigFile), vitestSetupFile);
381+
const vitestSetupFilePath = relative(dirname(newVitestConfigFile), vitestSetupFile);
379382

380383
logger.line(1);
381384
logger.plain(`${step} Creating a Vitest project config file:`);
@@ -497,17 +500,15 @@ async function getStorybookInfo({ configDir, packageManager: pkgMgr }: Postinsta
497500
}
498501

499502
const builderPackageJson = await fs.readFile(
500-
require.resolve(
501-
path.join(typeof builder === 'string' ? builder : builder.name, 'package.json')
502-
),
503+
require.resolve(join(typeof builder === 'string' ? builder : builder.name, 'package.json')),
503504
'utf8'
504505
);
505506
const builderPackageName = JSON.parse(builderPackageJson).name;
506507

507508
let rendererPackageName: string | undefined;
508509
if (renderer) {
509510
const rendererPackageJson = await fs.readFile(
510-
require.resolve(path.join(renderer, 'package.json')),
511+
require.resolve(join(renderer, 'package.json')),
511512
'utf8'
512513
);
513514
rendererPackageName = JSON.parse(rendererPackageJson).name;

code/addons/test/src/preset.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { readFileSync } from 'node:fs';
2-
import { isAbsolute, join } from 'node:path';
32

43
import type { Channel } from 'storybook/internal/channels';
54
import { checkAddonOrder, getFrameworkName, serverRequire } from 'storybook/internal/common';
@@ -11,6 +10,7 @@ import {
1110
import { oneWayHash, telemetry } from 'storybook/internal/telemetry';
1211
import type { Options, PresetProperty, StoryId } from 'storybook/internal/types';
1312

13+
import { isAbsolute, join } from 'pathe';
1414
import picocolors from 'picocolors';
1515
import { dedent } from 'ts-dedent';
1616

code/addons/test/src/vitest-plugin/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
/* eslint-disable no-underscore-dangle */
2-
import { join, resolve } from 'node:path';
3-
42
import type { Plugin } from 'vitest/config';
53

64
import {
@@ -12,6 +10,8 @@ import { readConfig, vitestTransform } from 'storybook/internal/csf-tools';
1210
import { MainFileMissingError } from 'storybook/internal/server-errors';
1311
import type { StoriesEntry } from 'storybook/internal/types';
1412

13+
import { join, resolve } from 'pathe';
14+
1515
import type { InternalOptions, UserOptions } from './types';
1616

1717
const defaultOptions: UserOptions = {

code/frameworks/angular/src/client/angular-beta/utils/PropertyExtractor.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
Provider,
1212
ɵReflectionCapabilities as ReflectionCapabilities,
1313
importProvidersFrom,
14+
VERSION,
1415
} from '@angular/core';
1516
import { BrowserModule } from '@angular/platform-browser';
1617
import {
@@ -176,15 +177,20 @@ export class PropertyExtractor implements NgModuleMetadata {
176177
const isDeclarable = isComponent || isDirective || isPipe;
177178

178179
// Check if the hierarchically lowest Component or Directive decorator (the only relevant for importing dependencies) is standalone.
179-
const isStandalone = !!(
180+
181+
let isStandalone =
180182
(isComponent || isDirective) &&
181183
[...decorators]
182184
.reverse() // reflectionCapabilities returns decorators in a hierarchically top-down order
183185
.find(
184186
(d) =>
185187
this.isDecoratorInstanceOf(d, 'Component') || this.isDecoratorInstanceOf(d, 'Directive')
186-
)?.standalone
187-
);
188+
)?.standalone;
189+
190+
//Starting in Angular 19 the default (in case it's undefined) value for standalone is true
191+
if (isStandalone === undefined) {
192+
isStandalone = !!(VERSION.major && Number(VERSION.major) >= 19);
193+
}
188194

189195
return { isDeclarable, isStandalone };
190196
};

0 commit comments

Comments
 (0)