Skip to content

Commit 3650f85

Browse files
authored
Merge pull request #29641 from storybookjs/version-non-patch-from-8.5.0-alpha.6
Release: Prerelease 8.5.0-alpha.7
2 parents 56952c7 + 6ebbbac commit 3650f85

File tree

8 files changed

+50
-10
lines changed

8 files changed

+50
-10
lines changed

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.7
2+
3+
- CLI: Disable corepack auto pin behavior - [#29627](https://github.com/storybookjs/storybook/pull/29627), thanks @yannbf!
4+
- RNW-Vite: Integrate with experimental-addon-test - [#29645](https://github.com/storybookjs/storybook/pull/29645), thanks @shilman!
5+
16
## 8.5.0-alpha.6
27

38
- CLI: Fix qwik init - [#29632](https://github.com/storybookjs/storybook/pull/29632), thanks @shilman!

code/addons/test/src/postinstall.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,12 @@ const getVitestPluginInfo = (framework: string) => {
453453
frameworkPluginCall = 'storybookVuePlugin()';
454454
}
455455

456+
if (framework === '@storybook/react-native-web-vite') {
457+
frameworkPluginImport =
458+
"import { storybookReactNativeWeb } from '@storybook/react-native-web-vite/vite-plugin';";
459+
frameworkPluginCall = 'storybookReactNativeWeb()';
460+
}
461+
456462
// spaces for file identation
457463
frameworkPluginImport = `\n${frameworkPluginImport}`;
458464
frameworkPluginDocs = frameworkPluginDocs ? `\n ${frameworkPluginDocs}` : '';
@@ -491,14 +497,19 @@ async function getStorybookInfo({ configDir, packageManager: pkgMgr }: Postinsta
491497
}
492498

493499
const builderPackageJson = await fs.readFile(
494-
`${typeof builder === 'string' ? builder : builder.name}/package.json`,
500+
require.resolve(
501+
path.join(typeof builder === 'string' ? builder : builder.name, 'package.json')
502+
),
495503
'utf8'
496504
);
497505
const builderPackageName = JSON.parse(builderPackageJson).name;
498506

499507
let rendererPackageName: string | undefined;
500508
if (renderer) {
501-
const rendererPackageJson = await fs.readFile(`${renderer}/package.json`, 'utf8');
509+
const rendererPackageJson = await fs.readFile(
510+
require.resolve(path.join(renderer, 'package.json')),
511+
'utf8'
512+
);
502513
rendererPackageName = JSON.parse(rendererPackageJson).name;
503514
}
504515

code/core/src/common/js-package-manager/JsPackageManagerFactory.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ function hasNPM(cwd?: string) {
141141
env: {
142142
...process.env,
143143
COREPACK_ENABLE_STRICT: '0',
144+
COREPACK_ENABLE_AUTO_PIN: '0',
144145
},
145146
});
146147
return npmVersionCommand.status === 0;
@@ -153,6 +154,7 @@ function hasBun(cwd?: string) {
153154
env: {
154155
...process.env,
155156
COREPACK_ENABLE_STRICT: '0',
157+
COREPACK_ENABLE_AUTO_PIN: '0',
156158
},
157159
});
158160
return pnpmVersionCommand.status === 0;
@@ -165,6 +167,7 @@ function hasPNPM(cwd?: string) {
165167
env: {
166168
...process.env,
167169
COREPACK_ENABLE_STRICT: '0',
170+
COREPACK_ENABLE_AUTO_PIN: '0',
168171
},
169172
});
170173
return pnpmVersionCommand.status === 0;
@@ -177,6 +180,7 @@ function getYarnVersion(cwd?: string): 1 | 2 | undefined {
177180
env: {
178181
...process.env,
179182
COREPACK_ENABLE_STRICT: '0',
183+
COREPACK_ENABLE_AUTO_PIN: '0',
180184
},
181185
});
182186

code/frameworks/react-native-web-vite/package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@
3030
"types": "./dist/preset.d.ts",
3131
"require": "./dist/preset.js"
3232
},
33+
"./vite-plugin": {
34+
"types": "./dist/vite-plugin.d.ts",
35+
"import": "./dist/vite-plugin.mjs",
36+
"require": "./dist/vite-plugin.js"
37+
},
3338
"./package.json": "./package.json"
3439
},
3540
"main": "dist/index.js",
@@ -75,7 +80,8 @@
7580
"bundler": {
7681
"entries": [
7782
"./src/index.ts",
78-
"./src/preset.ts"
83+
"./src/preset.ts",
84+
"./src/vite-plugin.ts"
7985
],
8086
"platform": "node"
8187
},

code/frameworks/react-native-web-vite/src/preset.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
// @ts-expect-error FIXME
22
import { viteFinal as reactViteFinal } from '@storybook/react-vite/preset';
33

4-
import type { BabelOptions, Options as ReactOptions } from '@vitejs/plugin-react';
54
import react from '@vitejs/plugin-react';
65
import type { PluginOption } from 'vite';
76

87
import type { FrameworkOptions, StorybookConfig } from './types';
98

10-
function reactNativeWeb(
11-
reactOptions: Omit<ReactOptions, 'babel'> & { babel?: BabelOptions }
12-
): PluginOption {
9+
export function reactNativeWeb(): PluginOption {
1310
return {
1411
name: 'vite:react-native-web',
1512
config(_userConfig, env) {
@@ -80,7 +77,7 @@ export const viteFinal: StorybookConfig['viteFinal'] = async (config, options) =
8077
...pluginReactOptions,
8178
})
8279
);
83-
plugins.push(reactNativeWeb(pluginReactOptions));
80+
plugins.push(reactNativeWeb());
8481

8582
return reactConfig;
8683
};
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import react from '@vitejs/plugin-react';
2+
3+
import { reactNativeWeb } from './preset';
4+
5+
export const storybookReactNativeWeb = () => {
6+
return [
7+
react({
8+
babel: {
9+
babelrc: false,
10+
configFile: false,
11+
},
12+
jsxRuntime: 'automatic',
13+
}),
14+
reactNativeWeb(),
15+
];
16+
};

code/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,5 +293,6 @@
293293
"Dependency Upgrades"
294294
]
295295
]
296-
}
296+
},
297+
"deferredNextVersion": "8.5.0-alpha.7"
297298
}

docs/versions/next.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"version":"8.5.0-alpha.6","info":{"plain":"- CLI: Fix qwik init - [#29632](https://github.com/storybookjs/storybook/pull/29632), thanks @shilman!\n- React Native Web: Add framework, CLI integration, sandboxes - [#29520](https://github.com/storybookjs/storybook/pull/29520), thanks @shilman!"}}
1+
{"version":"8.5.0-alpha.7","info":{"plain":"- CLI: Disable corepack auto pin behavior - [#29627](https://github.com/storybookjs/storybook/pull/29627), thanks @yannbf!\n- RNW-Vite: Integrate with experimental-addon-test - [#29645](https://github.com/storybookjs/storybook/pull/29645), thanks @shilman!"}}

0 commit comments

Comments
 (0)