Refactor and add generators for keystatic and package
The changes include refactoring the create-reader in cms keystatic and changing @keystatic/next version. Additionally, code generators for keystatic and package have been added, and corresponding templates have been organized into their respective directories.
This commit is contained in:
@@ -9,14 +9,10 @@ export async function createKeystaticReader() {
|
||||
switch (STORAGE_KIND) {
|
||||
case 'local': {
|
||||
if (process.env.NEXT_RUNTIME === 'nodejs') {
|
||||
const path = await import('node:path');
|
||||
const { default: config } = await import('./keystatic.config');
|
||||
const { createReader } = await import('@keystatic/core/reader');
|
||||
|
||||
const contentPath = process.env.NEXT_PUBLIC_KEYSTATIC_CONTENT_PATH;
|
||||
const repositoryPath = path.join(process.cwd(), contentPath as string);
|
||||
|
||||
return createReader(repositoryPath, config);
|
||||
return createReader(process.cwd(), config);
|
||||
} else {
|
||||
// we should never get here but the compiler requires the check
|
||||
// to ensure we don't parse the package at build time
|
||||
|
||||
Reference in New Issue
Block a user