@payloadcms/figma 0.0.1-alpha.31 → 0.0.1-alpha.32
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payload-config-modifier.d.ts","sourceRoot":"","sources":["../../src/utils/payload-config-modifier.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAI1D,OAAO,EAIL,KAAK,mBAAmB,EACzB,MAAM,yBAAyB,CAAA;AAKhC,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,OAAO,CAAA;IACjB,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;CACpB,CAAA;AAED;;;GAGG;AACH,wBAAsB,wBAAwB,CAC5C,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,cAAc,EAC9B,WAAW,CAAC,EAAE,mBAAmB,GAChC,OAAO,CAAC,kBAAkB,CAAC,
|
|
1
|
+
{"version":3,"file":"payload-config-modifier.d.ts","sourceRoot":"","sources":["../../src/utils/payload-config-modifier.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAI1D,OAAO,EAIL,KAAK,mBAAmB,EACzB,MAAM,yBAAyB,CAAA;AAKhC,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,OAAO,CAAA;IACjB,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;CACpB,CAAA;AAED;;;GAGG;AACH,wBAAsB,wBAAwB,CAC5C,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,cAAc,EAC9B,WAAW,CAAC,EAAE,mBAAmB,GAChC,OAAO,CAAC,kBAAkB,CAAC,CAoP7B;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAwC9D"}
|
|
@@ -140,6 +140,22 @@ import { runTypeScriptCheck } from './typescript-validator.js';
|
|
|
140
140
|
log.debug('@payloadcms/richtext-lexical already installed, skipping');
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
|
+
// Ensure cloud-storage is installed (required peer dependency for buildFigmaConfig)
|
|
144
|
+
log.debug('Checking if @payloadcms/plugin-cloud-storage is installed...');
|
|
145
|
+
const hasCloudStorage = await checkPackageInstalled(projectPath, '@payloadcms/plugin-cloud-storage');
|
|
146
|
+
if (!hasCloudStorage) {
|
|
147
|
+
log.debug('@payloadcms/plugin-cloud-storage not found, installing...');
|
|
148
|
+
try {
|
|
149
|
+
await installPackage(projectPath, '@payloadcms/plugin-cloud-storage', packageManager);
|
|
150
|
+
changes.push('Installed @payloadcms/plugin-cloud-storage');
|
|
151
|
+
log.debug('Successfully installed @payloadcms/plugin-cloud-storage');
|
|
152
|
+
} catch (error) {
|
|
153
|
+
log.debug(`Failed to install @payloadcms/plugin-cloud-storage: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
154
|
+
warnings.push('Could not install @payloadcms/plugin-cloud-storage - you may need to install it manually');
|
|
155
|
+
}
|
|
156
|
+
} else {
|
|
157
|
+
log.debug('@payloadcms/plugin-cloud-storage already installed, skipping');
|
|
158
|
+
}
|
|
143
159
|
if (packagesToUninstall.length > 0) {
|
|
144
160
|
log.debug(`Uninstalling ${packagesToUninstall.length} orphaned packages...`);
|
|
145
161
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/payload-config-modifier.ts"],"sourcesContent":["import pc from 'picocolors'\nimport { Project } from 'ts-morph'\n\nimport type { PackageManager } from './package-manager.js'\n\nimport { formatFile } from './formatter.js'\nimport * as log from './log.js'\nimport {\n addFigmaProperty,\n applyModifications,\n detectRequiredChanges,\n type FigmaPropertyConfig,\n} from './payload-config-ast.js'\nimport { findPayloadConfig } from './payload-config-finder.js'\nimport { checkPackageInstalled, installPackage, uninstallPackage } from './payload-package-check.js'\nimport { runTypeScriptCheck } from './typescript-validator.js'\n\nexport type ModificationResult = {\n changes: string[]\n error?: string\n modified: boolean\n success: boolean\n warnings?: string[]\n}\n\n/**\n * Main orchestrator for payload config modification\n * Checks package, detects needed changes, applies modifications\n */\nexport async function ensurePayloadFigmaConfig(\n projectPath: string,\n packageManager: PackageManager,\n figmaConfig?: FigmaPropertyConfig,\n): Promise<ModificationResult> {\n const changes: string[] = []\n const warnings: string[] = []\n let modified = false\n\n try {\n log.debug(`Starting payload config modification for: ${projectPath}`)\n\n // 1. Find config file\n const configPath = await findPayloadConfig(projectPath)\n if (!configPath) {\n log.debug(`Config file not found in: ${projectPath}`)\n return {\n changes: [],\n error: 'payload.config.ts not found in project',\n modified: false,\n success: false,\n }\n }\n\n log.debug(`Found config file: ${configPath}`)\n\n // 2. Check/install @payloadcms/figma package\n const isInstalled = await checkPackageInstalled(projectPath, '@payloadcms/figma')\n if (!isInstalled) {\n log.debug('@payloadcms/figma not installed, attempting installation...')\n try {\n await installPackage(projectPath, '@payloadcms/figma', packageManager)\n changes.push('Installed @payloadcms/figma')\n modified = true\n log.debug('@payloadcms/figma installed successfully')\n } catch (error) {\n log.debug(\n `Failed to install @payloadcms/figma: ${error instanceof Error ? error.message : 'Unknown error'}`,\n )\n return {\n changes: [],\n error: 'Failed to install @payloadcms/figma',\n modified: false,\n success: false,\n }\n }\n } else {\n log.debug('@payloadcms/figma already installed')\n }\n\n // 3. Parse config with ts-morph\n log.debug('Parsing config file with ts-morph...')\n const project = new Project({\n skipAddingFilesFromTsConfig: true,\n })\n const sourceFile = project.addSourceFileAtPath(configPath)\n\n // 4. Detect required changes\n log.debug('Detecting required changes...')\n const detection = detectRequiredChanges(sourceFile)\n\n log.debug(\n `Detection results: needsImportChange=${detection.needsImportChange}, hasAlias=${detection.hasAlias}, hasBuildConfig=${detection.hasBuildConfig}`,\n )\n\n // Handle failure modes\n if (detection.hasAlias) {\n log.debug('Config uses import alias (e.g., buildConfig as X)')\n return {\n changes,\n error: 'Config uses import alias - manual modification required',\n modified,\n success: false,\n }\n }\n\n if (detection.hasBuildConfig === false) {\n log.debug('No buildConfig call found in config file')\n return {\n changes,\n error: 'Config structure not recognized (no buildConfig call found)',\n modified,\n success: false,\n }\n }\n\n // 5. Apply modifications\n log.debug('Applying modifications...')\n const modResult = applyModifications(sourceFile, detection)\n if (modResult.modified) {\n changes.push(...modResult.changes)\n modified = true\n\n log.debug(`Applied ${modResult.changes.length} modifications`)\n }\n\n // 6. Add figma property if config provided and doesn't exist\n if (figmaConfig && !detection.figmaObjectExists) {\n log.debug('Adding figma property to buildConfig...')\n const figmaResult = addFigmaProperty(sourceFile, figmaConfig)\n if (figmaResult.modified) {\n changes.push(...figmaResult.changes)\n modified = true\n log.debug(`Added figma property`)\n } else {\n log.debug('Figma property not added (may already exist)')\n }\n } else if (detection.figmaObjectExists) {\n log.debug('Figma property already exists, skipping')\n }\n\n // Save file if any modifications were made\n if (modified) {\n await sourceFile.save()\n log.debug('Config file saved')\n\n // 7. Handle package management\n const packagesToUninstall: string[] = []\n\n // Uninstall db adapter (buildFigmaConfig provides its own)\n if (detection.dbProperty) {\n packagesToUninstall.push(detection.dbProperty.importSource)\n }\n\n // Uninstall sharp (Figma infrastructure handles image processing)\n if (detection.sharpProperty) {\n packagesToUninstall.push('sharp')\n }\n\n // Ensure lexical is installed if user doesn't have a custom editor\n // (buildFigmaConfig uses lexicalEditor() as default)\n if (!detection.editorProperty) {\n log.debug(\n 'No editor property detected - will ensure lexical is installed for default editor',\n )\n } else if (detection.editorProperty.isDefault) {\n log.debug('Default lexicalEditor() detected - will ensure lexical is installed')\n } else {\n log.debug(\n `Custom editor detected (${detection.editorProperty.importSource}) - skipping lexical installation`,\n )\n }\n\n if (!detection.editorProperty || detection.editorProperty.isDefault) {\n log.debug('Checking if @payloadcms/richtext-lexical is installed...')\n const hasLexical = await checkPackageInstalled(projectPath, '@payloadcms/richtext-lexical')\n if (!hasLexical) {\n log.debug('@payloadcms/richtext-lexical not found, installing...')\n try {\n await installPackage(projectPath, '@payloadcms/richtext-lexical', packageManager)\n changes.push('Installed @payloadcms/richtext-lexical (default editor)')\n log.debug('Successfully installed @payloadcms/richtext-lexical')\n } catch (error) {\n log.debug(\n `Failed to install @payloadcms/richtext-lexical: ${error instanceof Error ? error.message : 'Unknown error'}`,\n )\n // Don't fail on install error - user can install manually if needed\n warnings.push(\n 'Could not install @payloadcms/richtext-lexical - you may need to install it manually',\n )\n }\n } else {\n log.debug('@payloadcms/richtext-lexical already installed, skipping')\n }\n }\n\n if (packagesToUninstall.length > 0) {\n log.debug(`Uninstalling ${packagesToUninstall.length} orphaned packages...`)\n }\n\n for (const pkg of packagesToUninstall) {\n try {\n await uninstallPackage(projectPath, pkg, packageManager)\n changes.push(`Uninstalled ${pkg}`)\n log.debug(`Uninstalled ${pkg}`)\n } catch (error) {\n log.debug(\n `Failed to uninstall ${pkg}: ${error instanceof Error ? error.message : 'Unknown error'}`,\n )\n // Don't fail on uninstall errors - orphaned package is better than broken config\n }\n }\n\n // 8. Format file\n log.debug('Formatting config file...')\n const formatResult = await formatFile(configPath, packageManager)\n if (!formatResult.success && formatResult.warning) {\n warnings.push(formatResult.warning)\n log.debug(`Formatting warning: ${formatResult.warning}`)\n }\n\n // 9. Run TypeScript validation\n log.debug('Running TypeScript validation...')\n const tsResult = await runTypeScriptCheck(projectPath, packageManager)\n if (!tsResult.success && tsResult.errors.length > 0) {\n warnings.push(\"TypeScript validation found issues - run 'pnpm build' for details\")\n log.debug(`TypeScript validation found ${tsResult.errors.length} issues`)\n }\n } else {\n log.debug('No modifications needed - config already correct')\n }\n\n log.debug('Payload config modification completed successfully')\n\n return {\n changes,\n modified,\n success: true,\n warnings: warnings.length > 0 ? warnings : undefined,\n }\n } catch (error) {\n log.debug(\n `Unexpected error in ensurePayloadFigmaConfig: ${error instanceof Error ? error.message : 'Unknown error'}`,\n )\n if (error instanceof Error && error.stack) {\n log.debug(`Stack trace: ${error.stack}`)\n }\n return {\n changes,\n error: error instanceof Error ? error.message : 'Unknown error occurred',\n modified,\n success: false,\n }\n }\n}\n\n/**\n * Display manual configuration instructions\n */\nexport function displayManualInstructions(reason: string): void {\n const leftLineWrap = (message: string): string => {\n // Add '┌ ' prefix to first line, '│ ' to subsequent lines, and '└ ' to last line\n return message\n .split('\\n')\n .map((line, index, arr) => {\n if (index === 0) {\n return `${pc.dim('┌ ')}${line}`\n } else if (index === arr.length - 1) {\n return `${pc.dim('└ ')}${line}`\n } else {\n return `${pc.dim('│ ')}${line}`\n }\n })\n .join('\\n')\n }\n\n const message = leftLineWrap(`${pc.cyan(pc.bold('Manual Configuration Required'))}\n\nUnable to automatically modify payload.config.ts\nReason: ${pc.yellow(reason)}\n\n${pc.bold('Required changes:')}\n\n1. Replace buildConfig import:\n ${pc.dim('- FROM: ')}${pc.cyan(\"import { buildConfig } from 'payload'\")}\n ${pc.dim('- TO: ')}${pc.cyan(\"import { buildFigmaConfig } from '@payloadcms/figma'\")}\n\n2. Remove these properties from buildConfig():\n • db\n • secret\n • editor (if using default lexicalEditor())\n\n3. Install package:\n ${pc.cyan('pnpm add @payloadcms/figma')}\n\nThen run: ${pc.cyan('npx @payloadcms/figma init')}`)\n\n // eslint-disable-next-line no-console\n console.log(message)\n}\n"],"names":["pc","Project","formatFile","log","addFigmaProperty","applyModifications","detectRequiredChanges","findPayloadConfig","checkPackageInstalled","installPackage","uninstallPackage","runTypeScriptCheck","ensurePayloadFigmaConfig","projectPath","packageManager","figmaConfig","changes","warnings","modified","debug","configPath","error","success","isInstalled","push","Error","message","project","skipAddingFilesFromTsConfig","sourceFile","addSourceFileAtPath","detection","needsImportChange","hasAlias","hasBuildConfig","modResult","length","figmaObjectExists","figmaResult","save","packagesToUninstall","dbProperty","importSource","sharpProperty","editorProperty","isDefault","hasLexical","pkg","formatResult","warning","tsResult","errors","undefined","stack","displayManualInstructions","reason","leftLineWrap","split","map","line","index","arr","dim","join","cyan","bold","yellow","console"],"mappings":"AAAA,OAAOA,QAAQ,aAAY;AAC3B,SAASC,OAAO,QAAQ,WAAU;AAIlC,SAASC,UAAU,QAAQ,iBAAgB;AAC3C,YAAYC,SAAS,WAAU;AAC/B,SACEC,gBAAgB,EAChBC,kBAAkB,EAClBC,qBAAqB,QAEhB,0BAAyB;AAChC,SAASC,iBAAiB,QAAQ,6BAA4B;AAC9D,SAASC,qBAAqB,EAAEC,cAAc,EAAEC,gBAAgB,QAAQ,6BAA4B;AACpG,SAASC,kBAAkB,QAAQ,4BAA2B;AAU9D;;;CAGC,GACD,OAAO,eAAeC,yBACpBC,WAAmB,EACnBC,cAA8B,EAC9BC,WAAiC;IAEjC,MAAMC,UAAoB,EAAE;IAC5B,MAAMC,WAAqB,EAAE;IAC7B,IAAIC,WAAW;IAEf,IAAI;QACFf,IAAIgB,KAAK,CAAC,CAAC,0CAA0C,EAAEN,aAAa;QAEpE,sBAAsB;QACtB,MAAMO,aAAa,MAAMb,kBAAkBM;QAC3C,IAAI,CAACO,YAAY;YACfjB,IAAIgB,KAAK,CAAC,CAAC,0BAA0B,EAAEN,aAAa;YACpD,OAAO;gBACLG,SAAS,EAAE;gBACXK,OAAO;gBACPH,UAAU;gBACVI,SAAS;YACX;QACF;QAEAnB,IAAIgB,KAAK,CAAC,CAAC,mBAAmB,EAAEC,YAAY;QAE5C,6CAA6C;QAC7C,MAAMG,cAAc,MAAMf,sBAAsBK,aAAa;QAC7D,IAAI,CAACU,aAAa;YAChBpB,IAAIgB,KAAK,CAAC;YACV,IAAI;gBACF,MAAMV,eAAeI,aAAa,qBAAqBC;gBACvDE,QAAQQ,IAAI,CAAC;gBACbN,WAAW;gBACXf,IAAIgB,KAAK,CAAC;YACZ,EAAE,OAAOE,OAAO;g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AAc9D,GAAGgE,IAAI,CAAC,yCAAyC;GACxE,EAAEhE,GAAG8D,GAAG,CAAC,cAAc9D,GAAGgE,IAAI,CAAC,wDAAwD;;;;;;;;GAQvF,EAAEhE,GAAGgE,IAAI,CAAC,8BAA8B;;UAEjC,EAAEhE,GAAGgE,IAAI,CAAC,+BAA+B;IAEjD,sCAAsC;IACtCG,QAAQhE,GAAG,CAACuB;AACd"}
|
|
1
|
+
{"version":3,"sources":["../../src/utils/payload-config-modifier.ts"],"sourcesContent":["import pc from 'picocolors'\nimport { Project } from 'ts-morph'\n\nimport type { PackageManager } from './package-manager.js'\n\nimport { formatFile } from './formatter.js'\nimport * as log from './log.js'\nimport {\n addFigmaProperty,\n applyModifications,\n detectRequiredChanges,\n type FigmaPropertyConfig,\n} from './payload-config-ast.js'\nimport { findPayloadConfig } from './payload-config-finder.js'\nimport { checkPackageInstalled, installPackage, uninstallPackage } from './payload-package-check.js'\nimport { runTypeScriptCheck } from './typescript-validator.js'\n\nexport type ModificationResult = {\n changes: string[]\n error?: string\n modified: boolean\n success: boolean\n warnings?: string[]\n}\n\n/**\n * Main orchestrator for payload config modification\n * Checks package, detects needed changes, applies modifications\n */\nexport async function ensurePayloadFigmaConfig(\n projectPath: string,\n packageManager: PackageManager,\n figmaConfig?: FigmaPropertyConfig,\n): Promise<ModificationResult> {\n const changes: string[] = []\n const warnings: string[] = []\n let modified = false\n\n try {\n log.debug(`Starting payload config modification for: ${projectPath}`)\n\n // 1. Find config file\n const configPath = await findPayloadConfig(projectPath)\n if (!configPath) {\n log.debug(`Config file not found in: ${projectPath}`)\n return {\n changes: [],\n error: 'payload.config.ts not found in project',\n modified: false,\n success: false,\n }\n }\n\n log.debug(`Found config file: ${configPath}`)\n\n // 2. Check/install @payloadcms/figma package\n const isInstalled = await checkPackageInstalled(projectPath, '@payloadcms/figma')\n if (!isInstalled) {\n log.debug('@payloadcms/figma not installed, attempting installation...')\n try {\n await installPackage(projectPath, '@payloadcms/figma', packageManager)\n changes.push('Installed @payloadcms/figma')\n modified = true\n log.debug('@payloadcms/figma installed successfully')\n } catch (error) {\n log.debug(\n `Failed to install @payloadcms/figma: ${error instanceof Error ? error.message : 'Unknown error'}`,\n )\n return {\n changes: [],\n error: 'Failed to install @payloadcms/figma',\n modified: false,\n success: false,\n }\n }\n } else {\n log.debug('@payloadcms/figma already installed')\n }\n\n // 3. Parse config with ts-morph\n log.debug('Parsing config file with ts-morph...')\n const project = new Project({\n skipAddingFilesFromTsConfig: true,\n })\n const sourceFile = project.addSourceFileAtPath(configPath)\n\n // 4. Detect required changes\n log.debug('Detecting required changes...')\n const detection = detectRequiredChanges(sourceFile)\n\n log.debug(\n `Detection results: needsImportChange=${detection.needsImportChange}, hasAlias=${detection.hasAlias}, hasBuildConfig=${detection.hasBuildConfig}`,\n )\n\n // Handle failure modes\n if (detection.hasAlias) {\n log.debug('Config uses import alias (e.g., buildConfig as X)')\n return {\n changes,\n error: 'Config uses import alias - manual modification required',\n modified,\n success: false,\n }\n }\n\n if (detection.hasBuildConfig === false) {\n log.debug('No buildConfig call found in config file')\n return {\n changes,\n error: 'Config structure not recognized (no buildConfig call found)',\n modified,\n success: false,\n }\n }\n\n // 5. Apply modifications\n log.debug('Applying modifications...')\n const modResult = applyModifications(sourceFile, detection)\n if (modResult.modified) {\n changes.push(...modResult.changes)\n modified = true\n\n log.debug(`Applied ${modResult.changes.length} modifications`)\n }\n\n // 6. Add figma property if config provided and doesn't exist\n if (figmaConfig && !detection.figmaObjectExists) {\n log.debug('Adding figma property to buildConfig...')\n const figmaResult = addFigmaProperty(sourceFile, figmaConfig)\n if (figmaResult.modified) {\n changes.push(...figmaResult.changes)\n modified = true\n log.debug(`Added figma property`)\n } else {\n log.debug('Figma property not added (may already exist)')\n }\n } else if (detection.figmaObjectExists) {\n log.debug('Figma property already exists, skipping')\n }\n\n // Save file if any modifications were made\n if (modified) {\n await sourceFile.save()\n log.debug('Config file saved')\n\n // 7. Handle package management\n const packagesToUninstall: string[] = []\n\n // Uninstall db adapter (buildFigmaConfig provides its own)\n if (detection.dbProperty) {\n packagesToUninstall.push(detection.dbProperty.importSource)\n }\n\n // Uninstall sharp (Figma infrastructure handles image processing)\n if (detection.sharpProperty) {\n packagesToUninstall.push('sharp')\n }\n\n // Ensure lexical is installed if user doesn't have a custom editor\n // (buildFigmaConfig uses lexicalEditor() as default)\n if (!detection.editorProperty) {\n log.debug(\n 'No editor property detected - will ensure lexical is installed for default editor',\n )\n } else if (detection.editorProperty.isDefault) {\n log.debug('Default lexicalEditor() detected - will ensure lexical is installed')\n } else {\n log.debug(\n `Custom editor detected (${detection.editorProperty.importSource}) - skipping lexical installation`,\n )\n }\n\n if (!detection.editorProperty || detection.editorProperty.isDefault) {\n log.debug('Checking if @payloadcms/richtext-lexical is installed...')\n const hasLexical = await checkPackageInstalled(projectPath, '@payloadcms/richtext-lexical')\n if (!hasLexical) {\n log.debug('@payloadcms/richtext-lexical not found, installing...')\n try {\n await installPackage(projectPath, '@payloadcms/richtext-lexical', packageManager)\n changes.push('Installed @payloadcms/richtext-lexical (default editor)')\n log.debug('Successfully installed @payloadcms/richtext-lexical')\n } catch (error) {\n log.debug(\n `Failed to install @payloadcms/richtext-lexical: ${error instanceof Error ? error.message : 'Unknown error'}`,\n )\n // Don't fail on install error - user can install manually if needed\n warnings.push(\n 'Could not install @payloadcms/richtext-lexical - you may need to install it manually',\n )\n }\n } else {\n log.debug('@payloadcms/richtext-lexical already installed, skipping')\n }\n }\n\n // Ensure cloud-storage is installed (required peer dependency for buildFigmaConfig)\n log.debug('Checking if @payloadcms/plugin-cloud-storage is installed...')\n const hasCloudStorage = await checkPackageInstalled(\n projectPath,\n '@payloadcms/plugin-cloud-storage',\n )\n if (!hasCloudStorage) {\n log.debug('@payloadcms/plugin-cloud-storage not found, installing...')\n try {\n await installPackage(projectPath, '@payloadcms/plugin-cloud-storage', packageManager)\n changes.push('Installed @payloadcms/plugin-cloud-storage')\n log.debug('Successfully installed @payloadcms/plugin-cloud-storage')\n } catch (error) {\n log.debug(\n `Failed to install @payloadcms/plugin-cloud-storage: ${error instanceof Error ? error.message : 'Unknown error'}`,\n )\n warnings.push(\n 'Could not install @payloadcms/plugin-cloud-storage - you may need to install it manually',\n )\n }\n } else {\n log.debug('@payloadcms/plugin-cloud-storage already installed, skipping')\n }\n\n if (packagesToUninstall.length > 0) {\n log.debug(`Uninstalling ${packagesToUninstall.length} orphaned packages...`)\n }\n\n for (const pkg of packagesToUninstall) {\n try {\n await uninstallPackage(projectPath, pkg, packageManager)\n changes.push(`Uninstalled ${pkg}`)\n log.debug(`Uninstalled ${pkg}`)\n } catch (error) {\n log.debug(\n `Failed to uninstall ${pkg}: ${error instanceof Error ? error.message : 'Unknown error'}`,\n )\n // Don't fail on uninstall errors - orphaned package is better than broken config\n }\n }\n\n // 8. Format file\n log.debug('Formatting config file...')\n const formatResult = await formatFile(configPath, packageManager)\n if (!formatResult.success && formatResult.warning) {\n warnings.push(formatResult.warning)\n log.debug(`Formatting warning: ${formatResult.warning}`)\n }\n\n // 9. Run TypeScript validation\n log.debug('Running TypeScript validation...')\n const tsResult = await runTypeScriptCheck(projectPath, packageManager)\n if (!tsResult.success && tsResult.errors.length > 0) {\n warnings.push(\"TypeScript validation found issues - run 'pnpm build' for details\")\n log.debug(`TypeScript validation found ${tsResult.errors.length} issues`)\n }\n } else {\n log.debug('No modifications needed - config already correct')\n }\n\n log.debug('Payload config modification completed successfully')\n\n return {\n changes,\n modified,\n success: true,\n warnings: warnings.length > 0 ? warnings : undefined,\n }\n } catch (error) {\n log.debug(\n `Unexpected error in ensurePayloadFigmaConfig: ${error instanceof Error ? error.message : 'Unknown error'}`,\n )\n if (error instanceof Error && error.stack) {\n log.debug(`Stack trace: ${error.stack}`)\n }\n return {\n changes,\n error: error instanceof Error ? error.message : 'Unknown error occurred',\n modified,\n success: false,\n }\n }\n}\n\n/**\n * Display manual configuration instructions\n */\nexport function displayManualInstructions(reason: string): void {\n const leftLineWrap = (message: string): string => {\n // Add '┌ ' prefix to first line, '│ ' to subsequent lines, and '└ ' to last line\n return message\n .split('\\n')\n .map((line, index, arr) => {\n if (index === 0) {\n return `${pc.dim('┌ ')}${line}`\n } else if (index === arr.length - 1) {\n return `${pc.dim('└ ')}${line}`\n } else {\n return `${pc.dim('│ ')}${line}`\n }\n })\n .join('\\n')\n }\n\n const message = leftLineWrap(`${pc.cyan(pc.bold('Manual Configuration Required'))}\n\nUnable to automatically modify payload.config.ts\nReason: ${pc.yellow(reason)}\n\n${pc.bold('Required changes:')}\n\n1. Replace buildConfig import:\n ${pc.dim('- FROM: ')}${pc.cyan(\"import { buildConfig } from 'payload'\")}\n ${pc.dim('- TO: ')}${pc.cyan(\"import { buildFigmaConfig } from '@payloadcms/figma'\")}\n\n2. Remove these properties from buildConfig():\n • db\n • secret\n • editor (if using default lexicalEditor())\n\n3. Install package:\n ${pc.cyan('pnpm add @payloadcms/figma')}\n\nThen run: ${pc.cyan('npx @payloadcms/figma init')}`)\n\n // eslint-disable-next-line no-console\n console.log(message)\n}\n"],"names":["pc","Project","formatFile","log","addFigmaProperty","applyModifications","detectRequiredChanges","findPayloadConfig","checkPackageInstalled","installPackage","uninstallPackage","runTypeScriptCheck","ensurePayloadFigmaConfig","projectPath","packageManager","figmaConfig","changes","warnings","modified","debug","configPath","error","success","isInstalled","push","Error","message","project","skipAddingFilesFromTsConfig","sourceFile","addSourceFileAtPath","detection","needsImportChange","hasAlias","hasBuildConfig","modResult","length","figmaObjectExists","figmaResult","save","packagesToUninstall","dbProperty","importSource","sharpProperty","editorProperty","isDefault","hasLexical","hasCloudStorage","pkg","formatResult","warning","tsResult","errors","undefined","stack","displayManualInstructions","reason","leftLineWrap","split","map","line","index","arr","dim","join","cyan","bold","yellow","console"],"mappings":"AAAA,OAAOA,QAAQ,aAAY;AAC3B,SAASC,OAAO,QAAQ,WAAU;AAIlC,SAASC,UAAU,QAAQ,iBAAgB;AAC3C,YAAYC,SAAS,WAAU;AAC/B,SACEC,gBAAgB,EAChB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IAAI,CAAC,kCAAkC;;;QAG5E,EAAElE,GAAGmE,MAAM,CAACX,QAAQ;;AAE5B,EAAExD,GAAGkE,IAAI,CAAC,qBAAqB;;;GAG5B,EAAElE,GAAG+D,GAAG,CAAC,cAAc/D,GAAGiE,IAAI,CAAC,yCAAyC;GACxE,EAAEjE,GAAG+D,GAAG,CAAC,cAAc/D,GAAGiE,IAAI,CAAC,wDAAwD;;;;;;;;GAQvF,EAAEjE,GAAGiE,IAAI,CAAC,8BAA8B;;UAEjC,EAAEjE,GAAGiE,IAAI,CAAC,+BAA+B;IAEjD,sCAAsC;IACtCG,QAAQjE,GAAG,CAACuB;AACd"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/figma",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.32",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -28,7 +28,6 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@clack/prompts": "^0.11.0",
|
|
30
30
|
"@figma/rest-api-spec": "^0.34.0",
|
|
31
|
-
"@payloadcms/plugin-cloud-storage": "3.66.0",
|
|
32
31
|
"@sindresorhus/slugify": "^3.0.0",
|
|
33
32
|
"arg": "^5.0.2",
|
|
34
33
|
"conf": "^13.0.1",
|
|
@@ -52,10 +51,14 @@
|
|
|
52
51
|
"vitest": "4.0.15"
|
|
53
52
|
},
|
|
54
53
|
"peerDependencies": {
|
|
54
|
+
"@payloadcms/plugin-cloud-storage": "^3.0.0",
|
|
55
55
|
"@payloadcms/richtext-lexical": "^3.0.0",
|
|
56
56
|
"payload": "^3.0.0"
|
|
57
57
|
},
|
|
58
58
|
"peerDependenciesMeta": {
|
|
59
|
+
"@payloadcms/plugin-cloud-storage": {
|
|
60
|
+
"optional": true
|
|
61
|
+
},
|
|
59
62
|
"@payloadcms/richtext-lexical": {
|
|
60
63
|
"optional": true
|
|
61
64
|
}
|