@majordigital/create-acorn 1.3.1 → 1.3.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.
@@ -318,16 +318,40 @@ export default function StoryblokProvider({ children }: PropsWithChildren) {
318
318
  console.log('Warning: Could not update layout.tsx with StoryblokProvider.');
319
319
  }
320
320
 
321
- // Add generate-types script to package.json
321
+ // Update package.json scripts for Storyblok
322
322
  const pkgPath = join(process.cwd(), 'package.json');
323
323
  try {
324
324
  const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
325
325
  if (!pkg.scripts) pkg.scripts = {};
326
+ pkg.scripts.dev = 'next dev --turbo --experimental-https';
327
+ pkg.scripts['build:snapshot'] = 'node src/scripts/generate-snapshot-entry.js';
328
+ pkg.scripts.build = 'npm run build:snapshot && next build';
329
+ pkg.scripts['build-stats'] = 'cross-env ANALYZE=true npm run build';
330
+ pkg.scripts.start = 'next start';
331
+ pkg.scripts.preview = 'next build && next start';
332
+ pkg.scripts.prepare = 'lefthook install || true';
333
+ pkg.scripts.check = 'biome lint . --skip suspicious/noConsole && biome format .';
334
+ pkg.scripts.fix = 'biome lint . --write --skip suspicious/noConsole && biome format . --write';
335
+ pkg.scripts['check:prod'] = 'biome check .';
336
+ pkg.scripts['fix:prod'] = 'biome check . --write';
326
337
  pkg.scripts['generate-types'] = `storyblok components pull --space ${spaceId} && storyblok types generate --type-suffix Storyblok --space ${spaceId}`;
338
+ pkg.scripts.storybook = 'storybook dev -p 6006';
339
+ pkg.scripts['build-storybook'] = 'storybook build';
327
340
  writeFileSync(pkgPath, `${JSON.stringify(pkg, null, 2)}\n`);
328
- console.log('Added "generate-types" script to package.json.');
341
+ console.log('Updated package.json scripts for Storyblok.');
329
342
  } catch {
330
- console.log('Warning: Could not update package.json with generate-types script.');
343
+ console.log('Warning: Could not update package.json scripts.');
344
+ }
345
+
346
+ // Update .env.example with the space ID
347
+ const envExamplePath = join(process.cwd(), '.env.example');
348
+ try {
349
+ let envContent = readFileSync(envExamplePath, 'utf-8');
350
+ envContent = envContent.replace('STORYBLOK_SPACE_ID=', `STORYBLOK_SPACE_ID=${spaceId}`);
351
+ writeFileSync(envExamplePath, envContent);
352
+ console.log('Updated .env.example with Space ID.');
353
+ } catch {
354
+ console.log('Warning: Could not update .env.example with Space ID.');
331
355
  }
332
356
 
333
357
  console.log('');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@majordigital/create-acorn",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
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",