@buildkitgg/storybook-config 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,12 +1,20 @@
1
1
  # Change Log - @buildkitgg/storybook-config
2
2
 
3
- <!-- This log was last generated on Tue, 03 Nov 2026 11:28:14 GMT and should not be manually modified. -->
3
+ <!-- This log was last generated on Mon, 09 Nov 2026 01:42:15 GMT and should not be manually modified. -->
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## 0.2.0
8
+
9
+ Mon, 09 Nov 2026 01:42:15 GMT
10
+
11
+ ### Minor changes
12
+
13
+ - Name the framework and addons by path so apps under pnpm don't install them, let defineMain take a config without a framework, and drop the Chromatic addon from the base (ajcraswell@gmail.com)
14
+
7
15
  ## 0.1.0
8
16
 
9
- Tue, 03 Nov 2026 11:28:14 GMT
17
+ Tue, 03 Nov 2026 11:33:32 GMT
10
18
 
11
19
  ### Minor changes
12
20
 
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # @buildkitgg/storybook-config
2
2
 
3
- Shared Storybook configuration for React and Vite: a base `main` config with the Chromatic, accessibility and Vitest
4
- addons, a base preview, and frames that give example stories a consistent layout.
3
+ Shared Storybook configuration for React and Vite: a base `main` config with the accessibility and Vitest addons, a base
4
+ preview, and frames that give example stories a consistent layout.
5
5
 
6
6
  ```sh
7
7
  pnpm add -D @buildkitgg/storybook-config storybook @storybook/react-vite
@@ -21,8 +21,12 @@ export default defineMain({
21
21
  })
22
22
  ```
23
23
 
24
- The base uses the `@storybook/react-vite` framework, adds `@chromatic-com/storybook`, `@storybook/addon-a11y` and
25
- `@storybook/addon-vitest`, and turns off telemetry. The addons are dependencies of this package.
24
+ The base uses the `@storybook/react-vite` framework, adds `@storybook/addon-a11y` and `@storybook/addon-vitest`, and
25
+ turns off telemetry. The framework and addons are dependencies of this package and are named by path, so your app
26
+ doesn't need to install them. Add app-specific addons, such as Chromatic's, under `addons` yourself.
27
+
28
+ Run the Vitest addon's story tests in CI only. They're too slow to run on every local test pass, so keep them out of the
29
+ test project your app runs locally.
26
30
 
27
31
  ## Preview
28
32
 
package/dist/main.d.ts CHANGED
@@ -1,9 +1,16 @@
1
1
  import { type StorybookConfig } from "@storybook/react-vite/node";
2
+ /**
3
+ * The folder of a package this one depends on. Storybook resolves addon and framework names from the app's folder,
4
+ * where pnpm doesn't put this package's dependencies, so the base names them by path.
5
+ */
6
+ export declare function packageFolder(name: string): string;
2
7
  /**
3
8
  * Shared Storybook base configuration for the monorepo. Consumers should not
4
9
  * redefine these — `defineMain` merges an app's config on top of the base.
5
10
  */
6
11
  export declare const baseConfig: Omit<StorybookConfig, "stories">;
12
+ /** An app's Storybook config, which needs no framework because the base sets one. */
13
+ export type MainOverrides = Omit<StorybookConfig, "framework"> & Partial<Pick<StorybookConfig, "framework">>;
7
14
  /**
8
15
  * Builds a Storybook `main` config by combining the shared base with an app's
9
16
  * overrides (addons concatenated, objects merged deeply), then running it
@@ -17,4 +24,4 @@ export declare const baseConfig: Omit<StorybookConfig, "stories">;
17
24
  * });
18
25
  * ```
19
26
  */
20
- export declare function defineMain(overrides: StorybookConfig): StorybookConfig;
27
+ export declare function defineMain(overrides: MainOverrides): StorybookConfig;
package/dist/main.js CHANGED
@@ -1,15 +1,24 @@
1
+ import { dirname } from "node:path";
2
+ import { fileURLToPath } from "node:url";
1
3
  import { defineMain as defineStorybookMain } from "@storybook/react-vite/node";
2
4
  import { deepMerge } from "./utils/merge.js";
5
+ /**
6
+ * The folder of a package this one depends on. Storybook resolves addon and framework names from the app's folder,
7
+ * where pnpm doesn't put this package's dependencies, so the base names them by path.
8
+ */
9
+ export function packageFolder(name) {
10
+ return dirname(fileURLToPath(import.meta.resolve(`${name}/package.json`)));
11
+ }
3
12
  /**
4
13
  * Shared Storybook base configuration for the monorepo. Consumers should not
5
14
  * redefine these — `defineMain` merges an app's config on top of the base.
6
15
  */
7
16
  export const baseConfig = {
8
17
  framework: {
9
- name: "@storybook/react-vite",
18
+ name: packageFolder("@storybook/react-vite"),
10
19
  options: {}
11
20
  },
12
- addons: ["@chromatic-com/storybook", "@storybook/addon-a11y", "@storybook/addon-vitest"],
21
+ addons: [packageFolder("@storybook/addon-a11y"), packageFolder("@storybook/addon-vitest")],
13
22
  core: {
14
23
  disableTelemetry: true
15
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buildkitgg/storybook-config",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Shared Storybook main and preview configuration, and story example frames.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -36,7 +36,6 @@
36
36
  "prepack": "pnpm build"
37
37
  },
38
38
  "dependencies": {
39
- "@chromatic-com/storybook": "^5.6.0",
40
39
  "@storybook/addon-a11y": "10.6.5",
41
40
  "@storybook/addon-vitest": "10.6.5",
42
41
  "@storybook/react": "10.6.5",