generator-bitloops 0.3.16 → 0.3.18
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/cli.mjs +2 -2
- package/package.json +1 -1
- package/setup/index.js +16 -19
- package/setup/templates/globals.css +1 -136
package/cli.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { createEnv } from 'yeoman-environment';
|
|
4
|
-
import npm from './package.json'
|
|
4
|
+
import npm from './package.json' with { type: 'json' };
|
|
5
5
|
|
|
6
6
|
console.log(`generator-bitloops v${npm.version}`);
|
|
7
7
|
|
|
@@ -19,7 +19,7 @@ const env = createEnv();
|
|
|
19
19
|
(async () => {
|
|
20
20
|
// Dynamically import the subgenerator path
|
|
21
21
|
const generatorPath = await import(`./${subgenerator}/index.js`);
|
|
22
|
-
|
|
22
|
+
|
|
23
23
|
// Register your generator
|
|
24
24
|
env.register(generatorPath.default, `bitloops:${subgenerator}`);
|
|
25
25
|
|
package/package.json
CHANGED
package/setup/index.js
CHANGED
|
@@ -96,12 +96,12 @@ export default class extends Generator {
|
|
|
96
96
|
|
|
97
97
|
this.installNextJS = async function () {
|
|
98
98
|
// Clone Next.js template with Tailwind if specified, using the project name
|
|
99
|
-
const createNextAppCommand = ['-y', 'create-next-app@
|
|
99
|
+
const createNextAppCommand = ['-y', 'create-next-app@15.3.3'];
|
|
100
100
|
createNextAppCommand.push(toKebabCase(this.options.project)); // Use the project name for the directory
|
|
101
101
|
createNextAppCommand.push('--app');
|
|
102
102
|
createNextAppCommand.push('--empty');
|
|
103
103
|
createNextAppCommand.push('--src-dir');
|
|
104
|
-
|
|
104
|
+
createNextAppCommand.push('--turbopack'); // when we go to Next.js 15
|
|
105
105
|
createNextAppCommand.push('--import-alias');
|
|
106
106
|
createNextAppCommand.push('@/*');
|
|
107
107
|
createNextAppCommand.push('--use-npm');
|
|
@@ -142,28 +142,30 @@ export default class extends Generator {
|
|
|
142
142
|
encoding: 'utf-8',
|
|
143
143
|
});
|
|
144
144
|
const versions = JSON.parse(versionsRaw);
|
|
145
|
-
|
|
146
|
-
// Filter for stable
|
|
145
|
+
|
|
146
|
+
// Filter for stable 9.0.x versions (exclude alpha/beta)
|
|
147
147
|
const stableVersions = versions
|
|
148
|
-
.filter(version => version.startsWith('
|
|
148
|
+
.filter(version => version.startsWith('9.0.'))
|
|
149
149
|
.filter(version => !version.includes('-')); // Exclude pre-releases like -alpha or -beta
|
|
150
|
-
|
|
150
|
+
|
|
151
151
|
// Sort descending and get the latest
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
if (!
|
|
155
|
-
throw new Error('No stable
|
|
152
|
+
const latest90 = stableVersions.sort((a, b) => (a > b ? -1 : 1))[0];
|
|
153
|
+
|
|
154
|
+
if (!latest90) {
|
|
155
|
+
throw new Error('No stable 9.0.x versions found.');
|
|
156
156
|
}
|
|
157
|
-
|
|
157
|
+
|
|
158
158
|
// Log the chosen version (optional)
|
|
159
|
-
this.log(`Latest stable
|
|
160
|
-
|
|
159
|
+
this.log(`Latest stable 9.0 version: ${latest90}`);
|
|
160
|
+
|
|
161
161
|
// Use `this.spawnCommandSync` with the selected version
|
|
162
162
|
this.spawnCommandSync('npx', [
|
|
163
163
|
'-y',
|
|
164
|
-
`storybook@${
|
|
164
|
+
`storybook@${latest90}`,
|
|
165
165
|
'init',
|
|
166
166
|
'--no-dev',
|
|
167
|
+
'--yes', // Skip all prompts
|
|
168
|
+
'--type', 'nextjs', // Specify Next.js as the framework
|
|
167
169
|
]);
|
|
168
170
|
this.log('Storybook installed!');
|
|
169
171
|
// if (this.options.tailwind && this.options.storybook) {
|
|
@@ -213,11 +215,6 @@ export default class extends Generator {
|
|
|
213
215
|
} catch (err) {
|
|
214
216
|
console.error('Error deleting sample stories directory:', err);
|
|
215
217
|
}
|
|
216
|
-
fs.unlinkSync(this.destinationPath('tailwind.config.ts'));
|
|
217
|
-
this.fs.copyTpl(
|
|
218
|
-
this.templatePath('tailwind.config.ts'),
|
|
219
|
-
this.destinationPath('tailwind.config.ts')
|
|
220
|
-
);
|
|
221
218
|
}
|
|
222
219
|
|
|
223
220
|
if (this.options.cypress) {
|
|
@@ -1,137 +1,2 @@
|
|
|
1
1
|
/* Tailwind CSS */
|
|
2
|
-
@
|
|
3
|
-
@tailwind components;
|
|
4
|
-
@tailwind utilities;
|
|
5
|
-
|
|
6
|
-
/* MEYER */
|
|
7
|
-
|
|
8
|
-
/* http://meyerweb.com/eric/tools/css/reset/
|
|
9
|
-
v2.0 | 20110126
|
|
10
|
-
License: none (public domain)
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
html,
|
|
14
|
-
body,
|
|
15
|
-
div,
|
|
16
|
-
span,
|
|
17
|
-
applet,
|
|
18
|
-
object,
|
|
19
|
-
iframe,
|
|
20
|
-
h1,
|
|
21
|
-
h2,
|
|
22
|
-
h3,
|
|
23
|
-
h4,
|
|
24
|
-
h5,
|
|
25
|
-
h6,
|
|
26
|
-
p,
|
|
27
|
-
blockquote,
|
|
28
|
-
pre,
|
|
29
|
-
a,
|
|
30
|
-
abbr,
|
|
31
|
-
acronym,
|
|
32
|
-
address,
|
|
33
|
-
big,
|
|
34
|
-
cite,
|
|
35
|
-
code,
|
|
36
|
-
del,
|
|
37
|
-
dfn,
|
|
38
|
-
em,
|
|
39
|
-
img,
|
|
40
|
-
ins,
|
|
41
|
-
kbd,
|
|
42
|
-
q,
|
|
43
|
-
s,
|
|
44
|
-
samp,
|
|
45
|
-
small,
|
|
46
|
-
strike,
|
|
47
|
-
strong,
|
|
48
|
-
sub,
|
|
49
|
-
sup,
|
|
50
|
-
tt,
|
|
51
|
-
var,
|
|
52
|
-
b,
|
|
53
|
-
u,
|
|
54
|
-
i,
|
|
55
|
-
center,
|
|
56
|
-
dl,
|
|
57
|
-
dt,
|
|
58
|
-
dd,
|
|
59
|
-
ol,
|
|
60
|
-
ul,
|
|
61
|
-
li,
|
|
62
|
-
fieldset,
|
|
63
|
-
form,
|
|
64
|
-
label,
|
|
65
|
-
legend,
|
|
66
|
-
table,
|
|
67
|
-
caption,
|
|
68
|
-
tbody,
|
|
69
|
-
tfoot,
|
|
70
|
-
thead,
|
|
71
|
-
tr,
|
|
72
|
-
th,
|
|
73
|
-
td,
|
|
74
|
-
article,
|
|
75
|
-
aside,
|
|
76
|
-
canvas,
|
|
77
|
-
details,
|
|
78
|
-
embed,
|
|
79
|
-
figure,
|
|
80
|
-
figcaption,
|
|
81
|
-
footer,
|
|
82
|
-
header,
|
|
83
|
-
hgroup,
|
|
84
|
-
menu,
|
|
85
|
-
nav,
|
|
86
|
-
output,
|
|
87
|
-
ruby,
|
|
88
|
-
section,
|
|
89
|
-
summary,
|
|
90
|
-
time,
|
|
91
|
-
mark,
|
|
92
|
-
audio,
|
|
93
|
-
video {
|
|
94
|
-
margin: 0;
|
|
95
|
-
padding: 0;
|
|
96
|
-
border-width: 0px;
|
|
97
|
-
font-size: 100%;
|
|
98
|
-
font: inherit;
|
|
99
|
-
vertical-align: baseline;
|
|
100
|
-
}
|
|
101
|
-
/* HTML5 display-role reset for older browsers */
|
|
102
|
-
article,
|
|
103
|
-
aside,
|
|
104
|
-
details,
|
|
105
|
-
figcaption,
|
|
106
|
-
figure,
|
|
107
|
-
footer,
|
|
108
|
-
header,
|
|
109
|
-
hgroup,
|
|
110
|
-
menu,
|
|
111
|
-
nav,
|
|
112
|
-
section {
|
|
113
|
-
display: block;
|
|
114
|
-
}
|
|
115
|
-
body {
|
|
116
|
-
line-height: 1;
|
|
117
|
-
}
|
|
118
|
-
ol,
|
|
119
|
-
ul {
|
|
120
|
-
list-style: none;
|
|
121
|
-
}
|
|
122
|
-
blockquote,
|
|
123
|
-
q {
|
|
124
|
-
quotes: none;
|
|
125
|
-
}
|
|
126
|
-
blockquote:before,
|
|
127
|
-
blockquote:after,
|
|
128
|
-
q:before,
|
|
129
|
-
q:after {
|
|
130
|
-
content: '';
|
|
131
|
-
content: none;
|
|
132
|
-
}
|
|
133
|
-
table {
|
|
134
|
-
border-collapse: collapse;
|
|
135
|
-
border-spacing: 0;
|
|
136
|
-
}
|
|
137
|
-
/** END MEYER */
|
|
2
|
+
@import 'tailwindcss';
|