generator-bitloops 0.3.29 → 0.3.30

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "generator-bitloops",
3
- "version": "0.3.29",
3
+ "version": "0.3.30",
4
4
  "description": "Next.js with TypeScript, Tailwind, Storybook and Cypress generator by Bitloops",
5
5
  "license": "MIT",
6
6
  "author": "Bitloops S.A.",
package/setup/index.js CHANGED
@@ -501,12 +501,13 @@ export default class extends Generator {
501
501
  // Copy .storybook template files
502
502
  const storybookFiles = [
503
503
  `${STORYBOOK_FOLDER}/main.ts`,
504
- `${STORYBOOK_FOLDER}/preview.tsx`,
505
504
  `${STORYBOOK_FOLDER}/vitest.setup.ts`,
506
505
  ];
507
506
 
508
507
  // Delete .storybook/preview.ts if it exists (generated by storybook init)
509
- deleteFileIfExists(this.destinationPath(`${STORYBOOK_FOLDER}/preview.ts`));
508
+ deleteFileIfExists(
509
+ this.destinationPath(`${STORYBOOK_FOLDER}/preview.ts`),
510
+ );
510
511
 
511
512
  storybookFiles.forEach((filePath) => {
512
513
  deleteFileIfExists(this.destinationPath(filePath));
@@ -1,58 +0,0 @@
1
- import React from "react";
2
- import type { Preview } from "@storybook/nextjs-vite";
3
- import {
4
- fontConfig,
5
- generateGoogleFontsUrl,
6
- } from "../src/lib/fonts/fonts.config";
7
- import "../platform-vite/src/setup";
8
- import "../src/app/globals.css";
9
- import "../src/i18n";
10
- import { worker } from "../src/mocks/browser";
11
- import { Provider } from "react-redux";
12
- import { store } from "../src/store";
13
-
14
- await worker.start({ onUnhandledRequest: "bypass" });
15
-
16
- // Inject Google Fonts stylesheet and CSS variables
17
- if (typeof document !== "undefined") {
18
- const link = document.createElement("link");
19
- link.rel = "stylesheet";
20
- link.href = generateGoogleFontsUrl();
21
- document.head.appendChild(link);
22
-
23
- // Set CSS variables
24
- const style = document.createElement("style");
25
- style.textContent = `
26
- :root {
27
- ${fontConfig.montserrat.variable}: '${fontConfig.montserrat.family}', system-ui, sans-serif;
28
- ${fontConfig.roboto.variable}: '${fontConfig.roboto.family}', system-ui, sans-serif;
29
- }
30
- `;
31
- document.head.appendChild(style);
32
- }
33
-
34
- const preview: Preview = {
35
- parameters: {
36
- controls: {
37
- matchers: {
38
- color: /(background|color)$/i,
39
- date: /Date$/i,
40
- },
41
- },
42
- a11y: {
43
- // 'todo' - show a11y violations in the test UI only
44
- // 'error' - fail CI on a11y violations
45
- // 'off' - skip a11y checks entirely
46
- test: "todo",
47
- },
48
- },
49
- decorators: [
50
- (Story) => (
51
- <Provider store={store}>
52
- <Story />
53
- </Provider>
54
- ),
55
- ],
56
- };
57
-
58
- export default preview;