Skip to content

Commit 289d711

Browse files
authored
chore: upgrade create-next-app to 15.3 and storybook to latest 9.0 (#4)
* chore: upgrade create-next-app to 14.2.29 and storybook to latest 9.0.x version * feat: upgrade create-next-app to 15.3.3 and enable turbopack * 0.3.17
1 parent 6831467 commit 289d711

File tree

4 files changed

+20
-158
lines changed

4 files changed

+20
-158
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "generator-bitloops",
3-
"version": "0.3.16",
3+
"version": "0.3.17",
44
"description": "Next.js with TypeScript, Tailwind, Storybook and Cypress generator by Bitloops",
55
"license": "MIT",
66
"author": "Bitloops S.A.",

setup/index.js

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,12 @@ export default class extends Generator {
9696

9797
this.installNextJS = async function () {
9898
// Clone Next.js template with Tailwind if specified, using the project name
99-
const createNextAppCommand = ['-y', 'create-next-app@14.2.16'];
99+
const createNextAppCommand = ['-y', 'create-next-app@15.3.3'];
100100
createNextAppCommand.push(toKebabCase(this.options.project)); // Use the project name for the directory
101101
createNextAppCommand.push('--app');
102102
createNextAppCommand.push('--empty');
103103
createNextAppCommand.push('--src-dir');
104-
// createNextAppCommand.push('--turbopack'); when we go to Next.js 15
104+
createNextAppCommand.push('--turbopack'); // when we go to Next.js 15
105105
createNextAppCommand.push('--import-alias');
106106
createNextAppCommand.push('@/*');
107107
createNextAppCommand.push('--use-npm');
@@ -142,28 +142,30 @@ export default class extends Generator {
142142
encoding: 'utf-8',
143143
});
144144
const versions = JSON.parse(versionsRaw);
145-
146-
// Filter for stable 8.4.x versions (exclude alpha/beta)
145+
146+
// Filter for stable 9.0.x versions (exclude alpha/beta)
147147
const stableVersions = versions
148-
.filter(version => version.startsWith('8.4.'))
148+
.filter(version => version.startsWith('9.0.'))
149149
.filter(version => !version.includes('-')); // Exclude pre-releases like -alpha or -beta
150-
150+
151151
// Sort descending and get the latest
152-
const latest84 = stableVersions.sort((a, b) => (a > b ? -1 : 1))[0];
153-
154-
if (!latest84) {
155-
throw new Error('No stable 8.4.x versions found.');
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.');
156156
}
157-
157+
158158
// Log the chosen version (optional)
159-
this.log(`Latest stable 8.4 version: ${latest84}`);
160-
159+
this.log(`Latest stable 9.0 version: ${latest90}`);
160+
161161
// Use `this.spawnCommandSync` with the selected version
162162
this.spawnCommandSync('npx', [
163163
'-y',
164-
`storybook@${latest84}`,
164+
`storybook@${latest90}`,
165165
'init',
166166
'--no-dev',
167+
'--yes', // Skip all prompts
168+
'--type', 'nextjs', // Specify Next.js as the framework
167169
]);
168170
this.log('Storybook installed!');
169171
// if (this.options.tailwind && this.options.storybook) {
@@ -213,11 +215,6 @@ export default class extends Generator {
213215
} catch (err) {
214216
console.error('Error deleting sample stories directory:', err);
215217
}
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-
);
221218
}
222219

223220
if (this.options.cypress) {

setup/templates/globals.css

Lines changed: 1 addition & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -1,137 +1,2 @@
11
/* Tailwind CSS */
2-
@tailwind base;
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';

0 commit comments

Comments
 (0)