generator-bitloops 0.3.21 → 0.3.22
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/app/index.js +1 -0
- package/package.json +1 -1
- package/setup/index.js +37 -21
package/app/index.js
CHANGED
|
@@ -11,6 +11,7 @@ export default class extends Generator {
|
|
|
11
11
|
this.option('tailwind'); // This method adds support for a `--tailwind` flag
|
|
12
12
|
this.option('storybook'); // This method adds support for a `--storybook` flag
|
|
13
13
|
this.option('cypress'); // This method adds support for a `--cypress` flag
|
|
14
|
+
this.option('primitives'); // This method adds support for a `--primitives` flag
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
message() {
|
package/package.json
CHANGED
package/setup/index.js
CHANGED
|
@@ -105,6 +105,12 @@ export default class extends Generator {
|
|
|
105
105
|
default: false,
|
|
106
106
|
});
|
|
107
107
|
|
|
108
|
+
this.option('primitives', {
|
|
109
|
+
type: Boolean,
|
|
110
|
+
description: 'Add primitives support',
|
|
111
|
+
default: false,
|
|
112
|
+
});
|
|
113
|
+
|
|
108
114
|
this.installNextJS = async function () {
|
|
109
115
|
// Clone Next.js template with Tailwind if specified, using the project name
|
|
110
116
|
const createNextAppCommand = ['-y', 'create-next-app@15.3.3'];
|
|
@@ -203,6 +209,36 @@ export default class extends Generator {
|
|
|
203
209
|
}
|
|
204
210
|
};
|
|
205
211
|
|
|
212
|
+
this.installPrimitives = function () {
|
|
213
|
+
// Conditionally add Primitives
|
|
214
|
+
if (this.options.primitives) {
|
|
215
|
+
this.log('Installing Primitives...');
|
|
216
|
+
|
|
217
|
+
const platformNextIndexPath = `${PLATFORM_NEXT_SRC_FOLDER}/index.ts`;
|
|
218
|
+
deleteFileIfExists(this.destinationPath(platformNextIndexPath));
|
|
219
|
+
this.fs.copyTpl(
|
|
220
|
+
this.templatePath(platformNextIndexPath),
|
|
221
|
+
this.destinationPath(platformNextIndexPath)
|
|
222
|
+
);
|
|
223
|
+
|
|
224
|
+
const platformNextImgPath = `${PLATFORM_NEXT_SRC_FOLDER}/Img.tsx`;
|
|
225
|
+
deleteFileIfExists(this.destinationPath(platformNextImgPath));
|
|
226
|
+
this.fs.copyTpl(
|
|
227
|
+
this.templatePath(platformNextImgPath),
|
|
228
|
+
this.destinationPath(platformNextImgPath)
|
|
229
|
+
);
|
|
230
|
+
|
|
231
|
+
const platformNextTypesPath = `${PLATFORM_NEXT_SRC_FOLDER}/types.ts`;
|
|
232
|
+
deleteFileIfExists(this.destinationPath(platformNextTypesPath));
|
|
233
|
+
this.fs.copyTpl(
|
|
234
|
+
this.templatePath(platformNextTypesPath),
|
|
235
|
+
this.destinationPath(platformNextTypesPath)
|
|
236
|
+
);
|
|
237
|
+
|
|
238
|
+
this.log('Primitives installed!');
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
|
|
206
242
|
this.patchFiles = async function () {
|
|
207
243
|
// Conditionally initialize Storybook
|
|
208
244
|
if (this.options.storybook) {
|
|
@@ -255,27 +291,6 @@ export default class extends Generator {
|
|
|
255
291
|
this.destinationPath('src/app/globals.css')
|
|
256
292
|
);
|
|
257
293
|
|
|
258
|
-
const platformNextIndexPath = `${PLATFORM_NEXT_SRC_FOLDER}/index.ts`;
|
|
259
|
-
deleteFileIfExists(this.destinationPath(platformNextIndexPath));
|
|
260
|
-
this.fs.copyTpl(
|
|
261
|
-
this.templatePath(platformNextIndexPath),
|
|
262
|
-
this.destinationPath(platformNextIndexPath)
|
|
263
|
-
);
|
|
264
|
-
|
|
265
|
-
const platformNextImgPath = `${PLATFORM_NEXT_SRC_FOLDER}/Img.tsx`;
|
|
266
|
-
deleteFileIfExists(this.destinationPath(platformNextImgPath));
|
|
267
|
-
this.fs.copyTpl(
|
|
268
|
-
this.templatePath(platformNextImgPath),
|
|
269
|
-
this.destinationPath(platformNextImgPath)
|
|
270
|
-
);
|
|
271
|
-
|
|
272
|
-
const platformNextTypesPath = `${PLATFORM_NEXT_SRC_FOLDER}/types.ts`;
|
|
273
|
-
deleteFileIfExists(this.destinationPath(platformNextTypesPath));
|
|
274
|
-
this.fs.copyTpl(
|
|
275
|
-
this.templatePath(platformNextTypesPath),
|
|
276
|
-
this.destinationPath(platformNextTypesPath)
|
|
277
|
-
);
|
|
278
|
-
|
|
279
294
|
if (this.options.bitloops) {
|
|
280
295
|
this.log('Adding Bitloops support components...');
|
|
281
296
|
const unsupportedPath =
|
|
@@ -361,6 +376,7 @@ export default class extends Generator {
|
|
|
361
376
|
await this.installNextJS();
|
|
362
377
|
this.installStorybook();
|
|
363
378
|
this.installCypress();
|
|
379
|
+
this.installPrimitives();
|
|
364
380
|
await this.patchFiles();
|
|
365
381
|
if (this.options.git) {
|
|
366
382
|
await this.commitChanges();
|