@storybook/addon-themes 7.6.0-alpha.0 → 7.6.0-alpha.1

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # `@storybook/addon-themes
1
+ # @storybook/addon-themes
2
2
 
3
3
  Storybook Addon Themes can be used which between multiple themes for components inside the preview in [Storybook](https://storybook.js.org).
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/addon-themes",
3
- "version": "7.6.0-alpha.0",
3
+ "version": "7.6.0-alpha.1",
4
4
  "description": "Switch between multiple themes for you components in Storybook",
5
5
  "keywords": [
6
6
  "css",
@@ -74,13 +74,13 @@
74
74
  "prep": "../../../scripts/prepare/bundle.ts"
75
75
  },
76
76
  "dependencies": {
77
- "@storybook/client-logger": "7.6.0-alpha.0",
78
- "@storybook/components": "7.6.0-alpha.0",
79
- "@storybook/core-events": "7.6.0-alpha.0",
80
- "@storybook/manager-api": "7.6.0-alpha.0",
81
- "@storybook/preview-api": "7.6.0-alpha.0",
82
- "@storybook/theming": "7.6.0-alpha.0",
83
- "@storybook/types": "7.6.0-alpha.0",
77
+ "@storybook/client-logger": "7.6.0-alpha.1",
78
+ "@storybook/components": "7.6.0-alpha.1",
79
+ "@storybook/core-events": "7.6.0-alpha.1",
80
+ "@storybook/manager-api": "7.6.0-alpha.1",
81
+ "@storybook/preview-api": "7.6.0-alpha.1",
82
+ "@storybook/theming": "7.6.0-alpha.1",
83
+ "@storybook/types": "7.6.0-alpha.1",
84
84
  "ts-dedent": "^2.0.0"
85
85
  },
86
86
  "devDependencies": {
package/postinstall.js CHANGED
@@ -1,17 +1,24 @@
1
1
  const { spawn } = require('child_process');
2
2
 
3
3
  const PACKAGE_MANAGER_TO_COMMAND = {
4
- npm: 'npx',
5
- yarn1: 'npx',
6
- yarn2: 'yarn dlx',
7
- pnpm: 'pnpm dlx',
4
+ npm: ['npx'],
5
+ pnpm: ['pnpm', 'dlx'],
6
+ yarn1: ['npx'],
7
+ yarn2: ['yarn', 'dlx'],
8
8
  };
9
9
 
10
- module.exports = function postinstall(options) {
11
- const command = PACKAGE_MANAGER_TO_COMMAND[options.packageManager];
10
+ const selectPackageManagerCommand = (packageManager) => PACKAGE_MANAGER_TO_COMMAND[packageManager];
12
11
 
13
- spawn(command, ['@storybook/auto-config', 'themes'], {
12
+ const spawnPackageManagerScript = async (packageManager, args) => {
13
+ const [command, ...baseArgs] = selectPackageManagerCommand(packageManager);
14
+
15
+ await spawn(command, [...baseArgs, ...args], {
14
16
  stdio: 'inherit',
15
17
  cwd: process.cwd(),
18
+ shell: true,
16
19
  });
17
20
  };
21
+
22
+ module.exports = async function postinstall({ packageManager = 'npm' }) {
23
+ await spawnPackageManagerScript(packageManager, ['@storybook/auto-config', 'themes']);
24
+ };