histoire 0.6.5 → 0.7.1

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.
@@ -14,7 +14,7 @@ var __spreadValues = (a, b) => {
14
14
  }
15
15
  return a;
16
16
  };
17
- import { Text, vModelText, vModelSelect, vModelRadio, vModelCheckbox, vModelDynamic, defineComponent, ref, createApp, onMounted, watch, onUnmounted, openBlock, createElementBlock } from "vue";
17
+ import { Text, vModelText, vModelSelect, vModelRadio, vModelCheckbox, vModelDynamic, defineComponent, computed, h, ref, createApp, onMounted, watch, onUnmounted, openBlock, createElementBlock } from "vue";
18
18
  import { pascal } from "case";
19
19
  import { a as applyStateToVariant } from "./state.js";
20
20
  import * as setup from "$histoire-setup";
@@ -509,6 +509,45 @@ function serializeAndCleanJs(value) {
509
509
  function cleanupExpression(expr) {
510
510
  return expr.replace(/\$setup\./g, "");
511
511
  }
512
+ const defaultRoute = {
513
+ path: "/",
514
+ name: void 0,
515
+ redirectedFrom: void 0,
516
+ params: {},
517
+ query: {},
518
+ hash: "",
519
+ fullPath: "/",
520
+ matched: [],
521
+ meta: {},
522
+ href: "/"
523
+ };
524
+ const RouterLinkStub = defineComponent({
525
+ name: "RouterLinkStub",
526
+ compatConfig: { MODE: 3 },
527
+ props: {
528
+ to: {
529
+ type: [String, Object],
530
+ required: true
531
+ },
532
+ custom: {
533
+ type: Boolean,
534
+ default: false
535
+ }
536
+ },
537
+ render() {
538
+ var _a, _b;
539
+ const route = computed(() => defaultRoute);
540
+ const children = (_b = (_a = this.$slots) == null ? void 0 : _a.default) == null ? void 0 : _b.call(_a, {
541
+ route,
542
+ href: computed(() => route.value.href),
543
+ isActive: computed(() => false),
544
+ isExactActive: computed(() => false),
545
+ navigate: async () => {
546
+ }
547
+ });
548
+ return this.custom ? children : h("a", void 0, children);
549
+ }
550
+ });
512
551
  const _sfc_main = /* @__PURE__ */ defineComponent({
513
552
  name: "SandboxVue3",
514
553
  props: {
@@ -615,6 +654,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
615
654
  return vnodes;
616
655
  }
617
656
  });
657
+ app.component("RouterLink", RouterLinkStub);
618
658
  if (typeof (generatedSetup == null ? void 0 : generatedSetup.setupVue3) === "function") {
619
659
  await generatedSetup.setupVue3({
620
660
  app,
@@ -702,6 +702,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
702
702
  const files$1 = ref(files.map((file) => mapFile(file)));
703
703
  const tree$1 = ref(tree);
704
704
  onUpdate((newFiles, newTree) => {
705
+ loading.value = false;
705
706
  files$1.value = newFiles.map((file) => {
706
707
  const existingFile = files$1.value.find((f) => f.id === file.id);
707
708
  return mapFile(file, existingFile);
@@ -742,6 +743,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent(__spreadProps(__spreadValues({
742
743
  const loading = ref(false);
743
744
  if (import.meta.hot && !files.length) {
744
745
  loading.value = true;
746
+ console.log("loading...");
745
747
  import.meta.hot.on("histoire:all-stories-loaded", () => {
746
748
  loading.value = false;
747
749
  });
@@ -26,6 +26,7 @@ const files = ref<StoryFile[]>(rawFiles.map(file => mapFile(file)))
26
26
  const tree = ref<Tree>(rawTree)
27
27
 
28
28
  onUpdate((newFiles: StoryFile[], newTree: Tree) => {
29
+ loading.value = false
29
30
  files.value = newFiles.map(file => {
30
31
  const existingFile = files.value.find(f => f.id === file.id)
31
32
  return mapFile(file, existingFile)
@@ -78,6 +79,7 @@ const loading = ref(false)
78
79
 
79
80
  if (import.meta.hot && !rawFiles.length) {
80
81
  loading.value = true
82
+ console.log('loading...')
81
83
  import.meta.hot.on('histoire:all-stories-loaded', () => {
82
84
  loading.value = false
83
85
  })
@@ -0,0 +1,21 @@
1
+ export declare const RouterLinkStub: import("vue").DefineComponent<{
2
+ to: {
3
+ type: (ObjectConstructor | StringConstructor)[];
4
+ required: true;
5
+ };
6
+ custom: {
7
+ type: BooleanConstructor;
8
+ default: boolean;
9
+ };
10
+ }, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
11
+ to: {
12
+ type: (ObjectConstructor | StringConstructor)[];
13
+ required: true;
14
+ };
15
+ custom: {
16
+ type: BooleanConstructor;
17
+ default: boolean;
18
+ };
19
+ }>>, {
20
+ custom: boolean;
21
+ }>;
@@ -0,0 +1,43 @@
1
+ // From: https://github.com/vuejs/test-utils/blob/main/src/components/RouterLinkStub.ts
2
+ import { defineComponent, h, computed } from 'vue';
3
+ // match return type of router.resolve: RouteLocation & { href: string }
4
+ const defaultRoute = {
5
+ path: '/',
6
+ name: undefined,
7
+ redirectedFrom: undefined,
8
+ params: {},
9
+ query: {},
10
+ hash: '',
11
+ fullPath: '/',
12
+ matched: [],
13
+ meta: {},
14
+ href: '/',
15
+ };
16
+ // TODO: Borrow typings from vue-router-next
17
+ export const RouterLinkStub = defineComponent({
18
+ name: 'RouterLinkStub',
19
+ compatConfig: { MODE: 3 },
20
+ props: {
21
+ to: {
22
+ type: [String, Object],
23
+ required: true,
24
+ },
25
+ custom: {
26
+ type: Boolean,
27
+ default: false,
28
+ },
29
+ },
30
+ render() {
31
+ const route = computed(() => defaultRoute);
32
+ // mock reasonable return values to mimic vue-router's useLink
33
+ const children = this.$slots?.default?.({
34
+ route,
35
+ href: computed(() => route.value.href),
36
+ isActive: computed(() => false),
37
+ isExactActive: computed(() => false),
38
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
39
+ navigate: async () => { },
40
+ });
41
+ return this.custom ? children : h('a', undefined, children);
42
+ },
43
+ });
@@ -3,6 +3,7 @@ import { App, createApp, onMounted, onUnmounted, PropType, ref, watch } from 'vu
3
3
  import { Story, Variant, PropDefinition, AutoPropComponentDefinition } from '../../types'
4
4
  import { getTagName } from '../../codegen/vue3'
5
5
  import { applyStateToVariant } from '../../util/state'
6
+ import { RouterLinkStub } from './RouterLinkStub'
6
7
  // @ts-expect-error virtual module id
7
8
  import * as setup from '$histoire-setup'
8
9
  // @ts-expect-error virtual module id
@@ -125,6 +126,9 @@ async function mountVariant () {
125
126
  },
126
127
  })
127
128
 
129
+ // Stubs
130
+ app.component('RouterLink', RouterLinkStub)
131
+
128
132
  if (typeof generatedSetup?.setupVue3 === 'function') {
129
133
  await generatedSetup.setupVue3({
130
134
  app,
@@ -1,8 +1,12 @@
1
1
  <script lang="ts">
2
2
  import { defineComponent, inject, onMounted, PropType, provide, useAttrs } from 'vue'
3
- import type { StoryFile, Story, Variant } from '../../node/types'
3
+ import type { StoryFile, Story, Variant } from '../../../node/types'
4
+
5
+ const stub = { name: 'StubbedComponent', render: () => null }
4
6
 
5
7
  export default defineComponent({
8
+ name: 'HistoireStory',
9
+
6
10
  inheritAttrs: false,
7
11
 
8
12
  props: {
@@ -87,13 +91,24 @@ export default defineComponent({
87
91
  render () {
88
92
  let suppressError = false
89
93
  try {
90
- return this.$slots.default?.({
94
+ const vnodes = this.$slots.default?.({
91
95
  get state () {
92
96
  // No variant tags
93
97
  suppressError = true
94
98
  return {}
95
99
  },
96
100
  })
101
+
102
+ // Auto stub components
103
+ if (Array.isArray(vnodes)) {
104
+ for (const vnode of vnodes) {
105
+ if (typeof vnode.type === 'object' && (vnode.type as any).name !== 'HistoireVariant') {
106
+ vnode.type = stub
107
+ }
108
+ }
109
+ }
110
+
111
+ return vnodes
97
112
  } catch (e) {
98
113
  if (!suppressError) {
99
114
  console.error(e)
@@ -1,8 +1,10 @@
1
1
  <script lang="ts">
2
2
  import { defineComponent, inject } from 'vue'
3
- import type { Story, Variant } from '../../node/types'
3
+ import type { Story, Variant } from '../../../node/types'
4
4
 
5
5
  export default defineComponent({
6
+ name: 'HistoireVariant',
7
+
6
8
  props: {
7
9
  title: {
8
10
  type: String,
@@ -49,7 +49,7 @@ export async function build(ctx) {
49
49
  const storyCount = ctx.storyFiles.reduce((sum, file) => sum + (file.story?.variants.length ? 1 : 0), 0);
50
50
  const variantCount = ctx.storyFiles.reduce((sum, file) => sum + (file.story?.variants.length ?? 0), 0);
51
51
  const emptyStoryCount = ctx.storyFiles.length - storyCount;
52
- const results = await viteBuild(mergeViteConfig(await getViteConfigWithPlugins(false, ctx), {
52
+ const buildViteConfig = mergeViteConfig(await getViteConfigWithPlugins(false, ctx), {
53
53
  mode: 'development',
54
54
  build: {
55
55
  rollupOptions: {
@@ -70,7 +70,34 @@ export async function build(ctx) {
70
70
  cssCodeSplit: false,
71
71
  minify: false,
72
72
  },
73
- }));
73
+ });
74
+ // For @vite/plugin-vue: Always put our vite server
75
+ // Disable template inlining
76
+ // (so that we no longer need defineExpose)
77
+ // Nuxt: replaces the Nuxt vite dev server
78
+ buildViteConfig.plugins.push({
79
+ name: 'histoire-vue-plugin-override',
80
+ config(config) {
81
+ const vuePlugin = config.plugins.find((p) => p.name === 'vite:vue');
82
+ if (vuePlugin) {
83
+ const original = vuePlugin.configureServer.bind(vuePlugin);
84
+ vuePlugin.configureServer = () => {
85
+ original({
86
+ ...server,
87
+ config: {
88
+ ...server.config,
89
+ server: {
90
+ ...server.config.server,
91
+ hmr: false,
92
+ },
93
+ },
94
+ });
95
+ };
96
+ vuePlugin.configureServer();
97
+ }
98
+ },
99
+ });
100
+ const results = await viteBuild(buildViteConfig);
74
101
  const result = Array.isArray(results) ? results[0] : results;
75
102
  const styleOutput = result.output.find(o => o.name === 'style.css' && o.type === 'asset');
76
103
  // Preload
@@ -12,8 +12,11 @@ export function useCollectStories(options, ctx) {
12
12
  deps: {
13
13
  inline: [
14
14
  /histoire\/dist/,
15
+ /@vue\/devtools-api/,
16
+ ...ctx.config.viteNodeInlineDeps ?? [],
15
17
  ],
16
18
  },
19
+ transformMode: ctx.config.viteNodeTransformMode,
17
20
  });
18
21
  const threadsCount = ctx.mode === 'dev'
19
22
  ? Math.max(cpus().length / 2, 1)
@@ -130,6 +130,30 @@ export interface HistoireConfig {
130
130
  * Vite config override
131
131
  */
132
132
  vite?: ViteConfig | ((config: ViteConfig, env: ViteConfigEnv) => void | ViteConfig | Promise<void | ViteConfig>);
133
+ /**
134
+ * Transpile dependencies when collecting stories on Node.js
135
+ */
136
+ viteNodeInlineDeps?: RegExp[];
137
+ /**
138
+ * Determine the transform method of modules
139
+ */
140
+ viteNodeTransformMode?: {
141
+ /**
142
+ * Use SSR transform pipeline for the specified files.
143
+ * Vite plugins will receive `ssr: true` flag when processing those files.
144
+ *
145
+ * @default [/\.([cm]?[jt]sx?|json)$/]
146
+ */
147
+ ssr?: RegExp[];
148
+ /**
149
+ * First do a normal transform pipeline (targeting browser),
150
+ * then then do a SSR rewrite to run the code in Node.
151
+ * Vite plugins will receive `ssr: false` flag when processing those files.
152
+ *
153
+ * @default other than `ssr`
154
+ */
155
+ web?: RegExp[];
156
+ };
133
157
  }
134
158
  export declare type ConfigMode = 'build' | 'dev';
135
159
  export declare function getDefaultConfig(): HistoireConfig;
@@ -49,8 +49,8 @@ export function addStory(relativeFilePath) {
49
49
  return file;
50
50
  }
51
51
  export function removeStory(relativeFilePath) {
52
- const fileId = Case.kebab(relativeFilePath);
53
- const index = context.storyFiles.findIndex((file) => file.id === fileId);
52
+ const absoluteFilePath = getAbsoluteFilePath(relativeFilePath);
53
+ const index = context.storyFiles.findIndex((file) => file.path === absoluteFilePath);
54
54
  if (index !== -1)
55
55
  context.storyFiles.splice(index, 1);
56
56
  }
package/dist/node/vite.js CHANGED
@@ -77,6 +77,9 @@ export async function getViteConfigWithPlugins(server, ctx) {
77
77
  fs: {
78
78
  allow: [DIST_PATH, TEMP_PATH, resolvedViteConfig.root, process.cwd()],
79
79
  },
80
+ watch: {
81
+ ignored: [`!**/node_modules/.histoire/**`],
82
+ },
80
83
  },
81
84
  define: {
82
85
  // We need to force this to be able to use `devtoolsRawSetupState`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "histoire",
3
- "version": "0.6.5",
3
+ "version": "0.7.1",
4
4
  "description": "A fast story book powered by Vite",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -33,7 +33,7 @@
33
33
  "histoire": "./bin.mjs"
34
34
  },
35
35
  "dependencies": {
36
- "@histoire/controls": "^0.6.5",
36
+ "@histoire/controls": "^0.7.1",
37
37
  "@iconify/vue": "^3.2.1",
38
38
  "@types/markdown-it": "^12.2.3",
39
39
  "@vueuse/core": "^8.2.5",
@@ -26,6 +26,7 @@ const files = ref<StoryFile[]>(rawFiles.map(file => mapFile(file)))
26
26
  const tree = ref<Tree>(rawTree)
27
27
 
28
28
  onUpdate((newFiles: StoryFile[], newTree: Tree) => {
29
+ loading.value = false
29
30
  files.value = newFiles.map(file => {
30
31
  const existingFile = files.value.find(f => f.id === file.id)
31
32
  return mapFile(file, existingFile)
@@ -78,6 +79,7 @@ const loading = ref(false)
78
79
 
79
80
  if (import.meta.hot && !rawFiles.length) {
80
81
  loading.value = true
82
+ console.log('loading...')
81
83
  import.meta.hot.on('histoire:all-stories-loaded', () => {
82
84
  loading.value = false
83
85
  })
@@ -0,0 +1,49 @@
1
+ // From: https://github.com/vuejs/test-utils/blob/main/src/components/RouterLinkStub.ts
2
+
3
+ import { defineComponent, h, computed } from 'vue'
4
+
5
+ // match return type of router.resolve: RouteLocation & { href: string }
6
+ const defaultRoute = {
7
+ path: '/',
8
+ name: undefined as string | undefined,
9
+ redirectedFrom: undefined as object | undefined,
10
+ params: {},
11
+ query: {},
12
+ hash: '',
13
+ fullPath: '/',
14
+ matched: [] as object[],
15
+ meta: {},
16
+ href: '/',
17
+ }
18
+
19
+ // TODO: Borrow typings from vue-router-next
20
+ export const RouterLinkStub = defineComponent({
21
+ name: 'RouterLinkStub',
22
+
23
+ compatConfig: { MODE: 3 },
24
+
25
+ props: {
26
+ to: {
27
+ type: [String, Object],
28
+ required: true,
29
+ },
30
+ custom: {
31
+ type: Boolean,
32
+ default: false,
33
+ },
34
+ },
35
+
36
+ render () {
37
+ const route = computed(() => defaultRoute)
38
+ // mock reasonable return values to mimic vue-router's useLink
39
+ const children = this.$slots?.default?.({
40
+ route,
41
+ href: computed(() => route.value.href),
42
+ isActive: computed(() => false),
43
+ isExactActive: computed(() => false),
44
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
45
+ navigate: async () => {},
46
+ })
47
+ return this.custom ? children : h('a', undefined, children)
48
+ },
49
+ })
@@ -3,6 +3,7 @@ import { App, createApp, onMounted, onUnmounted, PropType, ref, watch } from 'vu
3
3
  import { Story, Variant, PropDefinition, AutoPropComponentDefinition } from '../../types'
4
4
  import { getTagName } from '../../codegen/vue3'
5
5
  import { applyStateToVariant } from '../../util/state'
6
+ import { RouterLinkStub } from './RouterLinkStub'
6
7
  // @ts-expect-error virtual module id
7
8
  import * as setup from '$histoire-setup'
8
9
  // @ts-expect-error virtual module id
@@ -125,6 +126,9 @@ async function mountVariant () {
125
126
  },
126
127
  })
127
128
 
129
+ // Stubs
130
+ app.component('RouterLink', RouterLinkStub)
131
+
128
132
  if (typeof generatedSetup?.setupVue3 === 'function') {
129
133
  await generatedSetup.setupVue3({
130
134
  app,
@@ -1,8 +1,12 @@
1
1
  <script lang="ts">
2
2
  import { defineComponent, inject, onMounted, PropType, provide, useAttrs } from 'vue'
3
- import type { StoryFile, Story, Variant } from '../../node/types'
3
+ import type { StoryFile, Story, Variant } from '../../../node/types'
4
+
5
+ const stub = { name: 'StubbedComponent', render: () => null }
4
6
 
5
7
  export default defineComponent({
8
+ name: 'HistoireStory',
9
+
6
10
  inheritAttrs: false,
7
11
 
8
12
  props: {
@@ -87,13 +91,24 @@ export default defineComponent({
87
91
  render () {
88
92
  let suppressError = false
89
93
  try {
90
- return this.$slots.default?.({
94
+ const vnodes = this.$slots.default?.({
91
95
  get state () {
92
96
  // No variant tags
93
97
  suppressError = true
94
98
  return {}
95
99
  },
96
100
  })
101
+
102
+ // Auto stub components
103
+ if (Array.isArray(vnodes)) {
104
+ for (const vnode of vnodes) {
105
+ if (typeof vnode.type === 'object' && (vnode.type as any).name !== 'HistoireVariant') {
106
+ vnode.type = stub
107
+ }
108
+ }
109
+ }
110
+
111
+ return vnodes
97
112
  } catch (e) {
98
113
  if (!suppressError) {
99
114
  console.error(e)
@@ -1,8 +1,10 @@
1
1
  <script lang="ts">
2
2
  import { defineComponent, inject } from 'vue'
3
- import type { Story, Variant } from '../../node/types'
3
+ import type { Story, Variant } from '../../../node/types'
4
4
 
5
5
  export default defineComponent({
6
+ name: 'HistoireVariant',
7
+
6
8
  props: {
7
9
  title: {
8
10
  type: String,
package/src/node/build.ts CHANGED
@@ -65,7 +65,7 @@ export async function build (ctx: Context) {
65
65
  const variantCount = ctx.storyFiles.reduce((sum, file) => sum + (file.story?.variants.length ?? 0), 0)
66
66
  const emptyStoryCount = ctx.storyFiles.length - storyCount
67
67
 
68
- const results = await viteBuild(mergeViteConfig(await getViteConfigWithPlugins(false, ctx), {
68
+ const buildViteConfig = mergeViteConfig(await getViteConfigWithPlugins(false, ctx), {
69
69
  mode: 'development',
70
70
  build: {
71
71
  rollupOptions: {
@@ -86,7 +86,36 @@ export async function build (ctx: Context) {
86
86
  cssCodeSplit: false,
87
87
  minify: false,
88
88
  },
89
- }))
89
+ })
90
+
91
+ // For @vite/plugin-vue: Always put our vite server
92
+ // Disable template inlining
93
+ // (so that we no longer need defineExpose)
94
+ // Nuxt: replaces the Nuxt vite dev server
95
+ buildViteConfig.plugins.push({
96
+ name: 'histoire-vue-plugin-override',
97
+ config (config) {
98
+ const vuePlugin = config.plugins.find((p: any) => p.name === 'vite:vue')
99
+ if (vuePlugin) {
100
+ const original = vuePlugin.configureServer.bind(vuePlugin)
101
+ vuePlugin.configureServer = () => {
102
+ original({
103
+ ...server,
104
+ config: {
105
+ ...server.config,
106
+ server: {
107
+ ...server.config.server,
108
+ hmr: false,
109
+ },
110
+ },
111
+ })
112
+ }
113
+ vuePlugin.configureServer()
114
+ }
115
+ },
116
+ })
117
+
118
+ const results = await viteBuild(buildViteConfig)
90
119
  const result = Array.isArray(results) ? results[0] : results as RollupOutput
91
120
 
92
121
  const styleOutput = result.output.find(o => o.name === 'style.css' && o.type === 'asset')
@@ -24,8 +24,11 @@ export function useCollectStories (options: UseCollectStoriesOptions, ctx: Conte
24
24
  deps: {
25
25
  inline: [
26
26
  /histoire\/dist/,
27
+ /@vue\/devtools-api/,
28
+ ...ctx.config.viteNodeInlineDeps ?? [],
27
29
  ],
28
30
  },
31
+ transformMode: ctx.config.viteNodeTransformMode,
29
32
  })
30
33
 
31
34
  const threadsCount = ctx.mode === 'dev'
@@ -149,6 +149,30 @@ export interface HistoireConfig {
149
149
  * Vite config override
150
150
  */
151
151
  vite?: ViteConfig | ((config: ViteConfig, env: ViteConfigEnv) => void | ViteConfig | Promise<void | ViteConfig>)
152
+ /**
153
+ * Transpile dependencies when collecting stories on Node.js
154
+ */
155
+ viteNodeInlineDeps?: RegExp[]
156
+ /**
157
+ * Determine the transform method of modules
158
+ */
159
+ viteNodeTransformMode?: {
160
+ /**
161
+ * Use SSR transform pipeline for the specified files.
162
+ * Vite plugins will receive `ssr: true` flag when processing those files.
163
+ *
164
+ * @default [/\.([cm]?[jt]sx?|json)$/]
165
+ */
166
+ ssr?: RegExp[]
167
+ /**
168
+ * First do a normal transform pipeline (targeting browser),
169
+ * then then do a SSR rewrite to run the code in Node.
170
+ * Vite plugins will receive `ssr: false` flag when processing those files.
171
+ *
172
+ * @default other than `ssr`
173
+ */
174
+ web?: RegExp[]
175
+ }
152
176
  }
153
177
 
154
178
  export type ConfigMode = 'build' | 'dev'
@@ -53,7 +53,7 @@ export function addStory (relativeFilePath: string) {
53
53
  }
54
54
 
55
55
  const file: StoryFile = {
56
- id: fileId,
56
+ id: fileId, // The file id will be changed by the story id after it is collected
57
57
  path: absoluteFilePath,
58
58
  fileName,
59
59
  moduleId: `/${relativeFilePath}`,
@@ -63,8 +63,8 @@ export function addStory (relativeFilePath: string) {
63
63
  }
64
64
 
65
65
  export function removeStory (relativeFilePath: string) {
66
- const fileId = Case.kebab(relativeFilePath)
67
- const index = context.storyFiles.findIndex((file) => file.id === fileId)
66
+ const absoluteFilePath = getAbsoluteFilePath(relativeFilePath)
67
+ const index = context.storyFiles.findIndex((file) => file.path === absoluteFilePath)
68
68
  if (index !== -1) context.storyFiles.splice(index, 1)
69
69
  }
70
70
 
package/src/node/vite.ts CHANGED
@@ -93,6 +93,9 @@ export async function getViteConfigWithPlugins (server: boolean, ctx: Context):
93
93
  fs: {
94
94
  allow: [DIST_PATH, TEMP_PATH, resolvedViteConfig.root, process.cwd()],
95
95
  },
96
+ watch: {
97
+ ignored: [`!**/node_modules/.histoire/**`],
98
+ },
96
99
  },
97
100
  define: {
98
101
  // We need to force this to be able to use `devtoolsRawSetupState`
@@ -56,6 +56,7 @@ const colors = {
56
56
 
57
57
  module.exports = {
58
58
  ...inheritedConfig,
59
+ prefix: 'htw-',
59
60
  content: [
60
61
  './src/**/*.{vue,js,ts,jsx,tsx,md}',
61
62
  // Include controls CSS directly