generator-bitloops 0.3.0 → 0.3.2

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/README.md CHANGED
@@ -6,4 +6,4 @@ Nonetheless, you can use it independently to setup your next Next.js project wit
6
6
 
7
7
  ## How to run it
8
8
 
9
- `npx generator-bitloops setup --project="Your Project Name" --nextjs --typescript --tailwind --storybook --cypress`
9
+ `npx -y generator-bitloops setup --project="Your Project Name" --nextjs --typescript --tailwind --storybook --cypress`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "generator-bitloops",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
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
@@ -85,7 +85,9 @@ export default class extends Generator {
85
85
  }
86
86
 
87
87
  this.log("Installing Next.js...");
88
- await new Promise((resolve, error) => {exec(`npx ${createNextAppCommand.join(' ')} && cd ${toKebabCase(this.options.project)} && npm install next@14 react@18 react-dom@18 react-tooltip`).on('exit', (code) => {
88
+ const additionalPackages = 'react-tooltip';
89
+ const patchPackages = `next@14 react@18 react-dom@18 ${additionalPackages}`;
90
+ await new Promise((resolve, error) => {exec(`npx ${createNextAppCommand.join(' ')} && cd ${toKebabCase(this.options.project)} && npm install ${patchPackages}`).on('exit', (code) => {
89
91
  this.destinationRoot(this.destinationPath(toKebabCase(this.options.project)));
90
92
  resolve();
91
93
  });});
@@ -95,10 +97,11 @@ export default class extends Generator {
95
97
  // Conditionally initialize Storybook
96
98
  if (this.options.storybook) {
97
99
  this.log("Adding Storybook...");
98
- this.spawnCommandSync('npx', ['-y', 'storybook@latest', 'init', '--no-dev']);
99
- if (this.options.tailwind) {
100
- this.spawnCommandSync('npx', ['storybook@latest', 'add', '@storybook/addon-styling-webpack']);
101
- }
100
+ this.spawnCommandSync('npx', ['-y', 'storybook@8.4', 'init', '--no-dev']);
101
+ // if (this.options.tailwind) {
102
+ // Tailwind CSS specific setup if needed
103
+ // this.spawnCommandSync('npx', ['storybook@latest', 'add', '@storybook/addon-styling-webpack']);
104
+ // }
102
105
  }
103
106
  }
104
107
 
@@ -187,6 +190,12 @@ export default class extends Generator {
187
190
  this.templatePath('src.components.bitloops.Unsupported.tsx'),
188
191
  this.destinationPath('src/components/bitloops/Unsupported.tsx'),
189
192
  );
193
+ if (this.options.storybook) {
194
+ this.fs.copyTpl(
195
+ this.templatePath('src.components.bitloops.Unsupported.stories.tsx'),
196
+ this.destinationPath('src/components/bitloops/Unsupported.stories.tsx'),
197
+ );
198
+ }
190
199
  }
191
200
  }
192
201
 
@@ -0,0 +1,27 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { UnsupportedElement, UnsupportedElementProps } from './Unsupported';
3
+
4
+ const meta: Meta<typeof UnsupportedElement> = {
5
+ title: 'Bitloops/Unsupported',
6
+ component: UnsupportedElement,
7
+ parameters: {
8
+ layout: 'centered',
9
+ },
10
+ tags: ['autodocs'],
11
+ };
12
+
13
+ export default meta;
14
+
15
+ const props: UnsupportedElementProps = {
16
+ type: 'VECTOR',
17
+ elementClassName: 'w-128 h-32',
18
+ };
19
+
20
+ type Story = StoryObj<typeof UnsupportedElement>;
21
+
22
+ export const Default: Story = {
23
+ args: props,
24
+ parameters: {
25
+ layout: 'fullscreen',
26
+ },
27
+ };
@@ -3,6 +3,7 @@ import 'react-tooltip/dist/react-tooltip.css';
3
3
 
4
4
  type UnsupportedType =
5
5
  | 'VECTOR'
6
+ | 'GROUP'
6
7
  | 'STAR'
7
8
  | 'ELLIPSE'
8
9
  | 'LINE'
@@ -25,14 +26,7 @@ export function UnsupportedElement(props: UnsupportedElementProps) {
25
26
  <Tooltip
26
27
  id='tooltip'
27
28
  place='top'
28
- style={{
29
- backgroundColor: 'black',
30
- color: 'white',
31
- padding: '8px',
32
- borderRadius: '4px',
33
- fontSize: '0.75rem',
34
- whiteSpace: 'nowrap',
35
- }}
29
+ className='bg-black text-white p-2 rounded-[4px] text-xs whitespace-nowrap'
36
30
  />
37
31
  </div>
38
32
  );