@majordigital/create-acorn 1.0.1 → 1.0.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/bin/create-acorn.mjs +32 -6
- package/package.json +1 -1
package/bin/create-acorn.mjs
CHANGED
|
@@ -85,7 +85,7 @@ async function scaffoldNextApp() {
|
|
|
85
85
|
'.',
|
|
86
86
|
'--typescript',
|
|
87
87
|
'--tailwind',
|
|
88
|
-
'--eslint',
|
|
88
|
+
'--no-eslint',
|
|
89
89
|
'--app',
|
|
90
90
|
'--src-dir',
|
|
91
91
|
'--import-alias', '@/*',
|
|
@@ -94,6 +94,13 @@ async function scaffoldNextApp() {
|
|
|
94
94
|
console.log('');
|
|
95
95
|
console.log('Next.js project scaffolded successfully.');
|
|
96
96
|
console.log('');
|
|
97
|
+
|
|
98
|
+
console.log('Installing Biome for linting...');
|
|
99
|
+
await runCommand('npm', ['install', '--save-dev', '--save-exact', '@biomejs/biome']);
|
|
100
|
+
await runCommand('npx', ['@biomejs/biome', 'init']);
|
|
101
|
+
console.log('');
|
|
102
|
+
console.log('Biome configured successfully.');
|
|
103
|
+
console.log('');
|
|
97
104
|
}
|
|
98
105
|
|
|
99
106
|
async function setupPrismic() {
|
|
@@ -107,9 +114,15 @@ async function setupPrismic() {
|
|
|
107
114
|
const prefixed = defaultBase.startsWith('majordigital-') ? defaultBase : `majordigital-${defaultBase}`;
|
|
108
115
|
const suggested = nonInteractiveRepo || prefixed;
|
|
109
116
|
|
|
117
|
+
const hasExisting = await ask('Do you already have a Prismic repository? (y/n)', 'n');
|
|
118
|
+
const isExisting = hasExisting.toLowerCase() === 'y' || hasExisting.toLowerCase() === 'yes';
|
|
119
|
+
|
|
110
120
|
let repo = nonInteractiveRepo;
|
|
111
121
|
if (!repo) {
|
|
112
|
-
|
|
122
|
+
const prompt = isExisting
|
|
123
|
+
? 'Enter your existing Prismic repository name'
|
|
124
|
+
: 'Enter a name for your new Prismic repository';
|
|
125
|
+
repo = await ask(prompt, suggested);
|
|
113
126
|
}
|
|
114
127
|
|
|
115
128
|
if (!/^[a-z0-9-]+$/.test(repo)) {
|
|
@@ -117,15 +130,28 @@ async function setupPrismic() {
|
|
|
117
130
|
exit(1);
|
|
118
131
|
}
|
|
119
132
|
|
|
120
|
-
|
|
121
|
-
|
|
133
|
+
if (isExisting) {
|
|
134
|
+
console.log('');
|
|
135
|
+
console.log(`Connecting to existing Prismic repository: ${repo}`);
|
|
136
|
+
} else {
|
|
137
|
+
console.log('');
|
|
138
|
+
console.log(`Creating new Prismic repository: ${repo}`);
|
|
139
|
+
}
|
|
122
140
|
console.log('');
|
|
123
141
|
|
|
124
|
-
|
|
142
|
+
const initArgs = ['@slicemachine/init@latest', '--repository', repo];
|
|
143
|
+
if (isExisting) {
|
|
144
|
+
initArgs.push('--existing-repo');
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
await runCommand('npx', initArgs);
|
|
125
148
|
|
|
126
149
|
console.log('');
|
|
127
150
|
console.log('Prismic Slice Machine initialization complete.');
|
|
128
|
-
console.log('
|
|
151
|
+
console.log('');
|
|
152
|
+
console.log('NOTE: The default language is set to English - United States.');
|
|
153
|
+
console.log('Please update it to English - Europe (en-eu) in your Prismic project settings:');
|
|
154
|
+
console.log(`https://${repo}.prismic.io/settings/`);
|
|
129
155
|
console.log('');
|
|
130
156
|
}
|
|
131
157
|
|
package/package.json
CHANGED