generator-bitloops 0.3.5 → 0.3.7

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/setup/index.js +12 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "generator-bitloops",
3
- "version": "0.3.5",
3
+ "version": "0.3.7",
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
@@ -56,6 +56,12 @@ export default class extends Generator {
56
56
  default: false,
57
57
  });
58
58
 
59
+ this.option('bitloops', {
60
+ type: Boolean,
61
+ description: 'Add Bitloops specific boilerplate files',
62
+ default: false,
63
+ });
64
+
59
65
  this.option('git', {
60
66
  type: Boolean,
61
67
  description: 'Commit changes to git',
@@ -97,8 +103,9 @@ export default class extends Generator {
97
103
  this.installStorybook = function() {
98
104
  // Conditionally initialize Storybook
99
105
  if (this.options.storybook) {
100
- this.log("Adding Storybook...");
101
- this.spawnCommandSync('npx', ['-y', 'storybook@8.4', 'init', '--no-dev']);
106
+ this.log('Installing Storybook...');
107
+ this.spawnCommandSync('npx', ['-y', 'storybook@^8.4', 'init', '--no-dev']);
108
+ this.log('Storybook installed!');
102
109
  // if (this.options.tailwind && this.options.storybook) {
103
110
  // Tailwind CSS specific setup for older versions of Storybook
104
111
  // this.spawnCommandSync('npx', ['storybook@latest', 'add', '@storybook/addon-styling-webpack']);
@@ -109,15 +116,16 @@ export default class extends Generator {
109
116
  this.installCypress = function() {
110
117
  // Conditionally add Cypress
111
118
  if (this.options.cypress) {
112
- this.log("Adding Cypress...");
119
+ this.log('Installing Cypress...');
113
120
  this.spawnCommandSync('npm', ['install', '--save-dev', 'cypress']);
121
+ this.log('Cypress installed!');
114
122
  }
115
123
  }
116
124
 
117
125
  this.patchFiles = async function() {
118
126
  // Conditionally initialize Storybook
119
127
  if (this.options.storybook) {
120
- this.log("Making Storybook changes...");
128
+ this.log('Making Storybook changes...');
121
129
  if (this.options.tailwind) {
122
130
  fs.unlinkSync(this.destinationPath('.storybook/preview.ts'));
123
131
  this.log('Setting up Tailwind CSS with Storybook...');
@@ -211,11 +219,8 @@ export default class extends Generator {
211
219
 
212
220
  async main() {
213
221
  await this.installNextJS();
214
- this.log('Installing Storybook');
215
222
  this.installStorybook();
216
- this.log('Installing Cypress');
217
223
  this.installCypress();
218
- this.log('Patching files');
219
224
  await this.patchFiles();
220
225
  if (this.options.git) {
221
226
  await this.commitChanges();