@majordigital/create-acorn 1.0.2 → 1.0.3

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.
@@ -3,7 +3,8 @@
3
3
  import readline from 'node:readline';
4
4
  import { argv, exit } from 'node:process';
5
5
  import { spawn } from 'node:child_process';
6
- import { basename } from 'node:path';
6
+ import { basename, join } from 'node:path';
7
+ import { readFileSync, writeFileSync } from 'node:fs';
7
8
 
8
9
  const CMS_CHOICES = [
9
10
  { key: 'prismic', label: 'Prismic' },
@@ -146,12 +147,39 @@ async function setupPrismic() {
146
147
 
147
148
  await runCommand('npx', initArgs);
148
149
 
150
+ // Ensure slicemachine script exists in package.json
151
+ const pkgPath = join(process.cwd(), 'package.json');
152
+ try {
153
+ const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
154
+ if (!pkg.scripts) pkg.scripts = {};
155
+ if (!pkg.scripts.slicemachine) {
156
+ pkg.scripts.slicemachine = 'start-slicemachine';
157
+ writeFileSync(pkgPath, `${JSON.stringify(pkg, null, 2)}\n`);
158
+ console.log('');
159
+ console.log('Added "slicemachine" script to package.json.');
160
+ }
161
+ } catch {
162
+ console.log('Warning: Could not update package.json with slicemachine script.');
163
+ }
164
+
149
165
  console.log('');
150
- console.log('Prismic Slice Machine initialization complete.');
166
+ console.log('=== Prismic Setup Complete ===');
151
167
  console.log('');
152
168
  console.log('NOTE: The default language is set to English - United States.');
153
169
  console.log('Please update it to English - Europe (en-eu) in your Prismic project settings:');
154
- console.log(`https://${repo}.prismic.io/settings/`);
170
+ console.log(` https://${repo}.prismic.io/settings/`);
171
+ console.log('');
172
+ console.log('=== Next Steps ===');
173
+ console.log('');
174
+ console.log(' 1. Start the Prismic Dev Tool (Slice Machine):');
175
+ console.log(' npm run slicemachine');
176
+ console.log('');
177
+ console.log(' 2. Create your custom types in Slice Machine (http://localhost:9999)');
178
+ console.log('');
179
+ console.log(' 3. Push your custom types to Prismic when ready');
180
+ console.log('');
181
+ console.log(' 4. Start your dev server:');
182
+ console.log(' npm run dev');
155
183
  console.log('');
156
184
  }
157
185
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@majordigital/create-acorn",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Interactive scaffold for Acorn with Storyblok/Prismic/DatoCMS, TypeScript, and Tailwind.",
5
5
  "bin": {
6
6
  "create-acorn": "bin/create-acorn.mjs",