@majordigital/create-acorn 1.3.2 → 1.3.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.
- package/bin/create-acorn.mjs +0 -37
- package/package.json +1 -1
package/bin/create-acorn.mjs
CHANGED
|
@@ -281,43 +281,6 @@ async function setupStoryblok(projectName) {
|
|
|
281
281
|
cpSync(join(storyblokSrcDir, 'ui', 'FallbackComponent.tsx'), join(targetUiDir, 'FallbackComponent.tsx'));
|
|
282
282
|
console.log('Copied FallbackComponent (ui/FallbackComponent.tsx).');
|
|
283
283
|
|
|
284
|
-
// Create StoryblokProvider
|
|
285
|
-
const componentsDir = join(process.cwd(), 'src', 'components');
|
|
286
|
-
mkdirSync(componentsDir, { recursive: true });
|
|
287
|
-
writeFileSync(join(componentsDir, 'StoryblokProvider.tsx'), `'use client';
|
|
288
|
-
|
|
289
|
-
import { getStoryblokApi } from '@/lib/storyblok';
|
|
290
|
-
import type { PropsWithChildren } from 'react';
|
|
291
|
-
|
|
292
|
-
export default function StoryblokProvider({ children }: PropsWithChildren) {
|
|
293
|
-
getStoryblokApi();
|
|
294
|
-
return children;
|
|
295
|
-
}
|
|
296
|
-
`);
|
|
297
|
-
console.log('Created StoryblokProvider component.');
|
|
298
|
-
|
|
299
|
-
// Update layout.tsx to wrap with StoryblokProvider
|
|
300
|
-
const layoutPath = join(process.cwd(), 'src', 'app', 'layout.tsx');
|
|
301
|
-
try {
|
|
302
|
-
let layout = readFileSync(layoutPath, 'utf-8');
|
|
303
|
-
layout = layout.replace(
|
|
304
|
-
"import '@/styles/globals.css';",
|
|
305
|
-
"import '@/styles/globals.css';\n\nimport StoryblokProvider from '@/components/StoryblokProvider';"
|
|
306
|
-
);
|
|
307
|
-
layout = layout.replace(
|
|
308
|
-
'<html lang="en"',
|
|
309
|
-
'<StoryblokProvider>\n\t\t<html lang="en"'
|
|
310
|
-
);
|
|
311
|
-
layout = layout.replace(
|
|
312
|
-
'</html>',
|
|
313
|
-
'</html>\n\t\t</StoryblokProvider>'
|
|
314
|
-
);
|
|
315
|
-
writeFileSync(layoutPath, layout);
|
|
316
|
-
console.log('Updated layout.tsx with StoryblokProvider.');
|
|
317
|
-
} catch {
|
|
318
|
-
console.log('Warning: Could not update layout.tsx with StoryblokProvider.');
|
|
319
|
-
}
|
|
320
|
-
|
|
321
284
|
// Update package.json scripts for Storyblok
|
|
322
285
|
const pkgPath = join(process.cwd(), 'package.json');
|
|
323
286
|
try {
|
package/package.json
CHANGED