@payloadcms/figma 0.0.1-alpha.41 → 0.0.1-alpha.42

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.
Files changed (100) hide show
  1. package/dist/auth/oauth-flow.d.ts.map +1 -1
  2. package/dist/auth/oauth-flow.js +6 -3
  3. package/dist/auth/oauth-flow.js.map +1 -1
  4. package/dist/auth/refresh.d.ts +2 -1
  5. package/dist/auth/refresh.d.ts.map +1 -1
  6. package/dist/auth/refresh.js +11 -3
  7. package/dist/auth/refresh.js.map +1 -1
  8. package/dist/auth/token-store.d.ts +6 -4
  9. package/dist/auth/token-store.d.ts.map +1 -1
  10. package/dist/auth/token-store.js +17 -14
  11. package/dist/auth/token-store.js.map +1 -1
  12. package/dist/auth/types.d.ts +7 -4
  13. package/dist/auth/types.d.ts.map +1 -1
  14. package/dist/auth/types.js.map +1 -1
  15. package/dist/cli.js +8 -6
  16. package/dist/cli.js.map +1 -1
  17. package/dist/commands/deploy.d.ts.map +1 -1
  18. package/dist/commands/deploy.js +2 -1
  19. package/dist/commands/deploy.js.map +1 -1
  20. package/dist/commands/init.d.ts.map +1 -1
  21. package/dist/commands/init.js +12 -1
  22. package/dist/commands/init.js.map +1 -1
  23. package/dist/commands/list-tokens.d.ts +3 -3
  24. package/dist/commands/list-tokens.d.ts.map +1 -1
  25. package/dist/commands/list-tokens.js +20 -8
  26. package/dist/commands/list-tokens.js.map +1 -1
  27. package/dist/commands/login.d.ts.map +1 -1
  28. package/dist/commands/login.js +12 -4
  29. package/dist/commands/login.js.map +1 -1
  30. package/dist/commands/logout.d.ts +5 -4
  31. package/dist/commands/logout.d.ts.map +1 -1
  32. package/dist/commands/logout.js +55 -12
  33. package/dist/commands/logout.js.map +1 -1
  34. package/dist/db-content-api/generated/content-api-types.d.ts +163 -103
  35. package/dist/db-content-api/generated/content-api-types.d.ts.map +1 -1
  36. package/dist/db-content-api/generated/content-api-types.js.map +1 -1
  37. package/dist/db-content-api/index.d.ts.map +1 -1
  38. package/dist/db-content-api/index.js +73 -65
  39. package/dist/db-content-api/index.js.map +1 -1
  40. package/dist/db-content-api/temp-utilities/unwrapDocument.d.ts +31 -1
  41. package/dist/db-content-api/temp-utilities/unwrapDocument.d.ts.map +1 -1
  42. package/dist/db-content-api/temp-utilities/unwrapDocument.js +24 -24
  43. package/dist/db-content-api/temp-utilities/unwrapDocument.js.map +1 -1
  44. package/dist/db-content-api/utilities/buildPathTypes.d.ts +12 -0
  45. package/dist/db-content-api/utilities/buildPathTypes.d.ts.map +1 -0
  46. package/dist/db-content-api/utilities/buildPathTypes.js +157 -0
  47. package/dist/db-content-api/utilities/buildPathTypes.js.map +1 -0
  48. package/dist/db-content-api/utilities/data/index.d.ts +2 -0
  49. package/dist/db-content-api/utilities/data/index.d.ts.map +1 -1
  50. package/dist/db-content-api/utilities/data/index.js +8 -0
  51. package/dist/db-content-api/utilities/data/index.js.map +1 -1
  52. package/dist/db-content-api/utilities/where.d.ts.map +1 -1
  53. package/dist/db-content-api/utilities/where.js +17 -3
  54. package/dist/db-content-api/utilities/where.js.map +1 -1
  55. package/dist/oauth/components/LogoutButton/index.d.ts.map +1 -1
  56. package/dist/oauth/components/LogoutButton/index.js +5 -3
  57. package/dist/oauth/components/LogoutButton/index.js.map +1 -1
  58. package/dist/oauth/endpoints/getLoginEndpoint.d.ts.map +1 -1
  59. package/dist/oauth/endpoints/getLoginEndpoint.js +17 -7
  60. package/dist/oauth/endpoints/getLoginEndpoint.js.map +1 -1
  61. package/dist/oauth/endpoints/getLogoutEndpoint.d.ts.map +1 -1
  62. package/dist/oauth/endpoints/getLogoutEndpoint.js +7 -4
  63. package/dist/oauth/endpoints/getLogoutEndpoint.js.map +1 -1
  64. package/dist/plugin/build-config.js +3 -3
  65. package/dist/plugin/build-config.js.map +1 -1
  66. package/dist/storage-content-api/api-types.d.ts +8 -1
  67. package/dist/storage-content-api/api-types.d.ts.map +1 -1
  68. package/dist/storage-content-api/api-types.js.map +1 -1
  69. package/dist/storage-content-api/client-uploads/generateSignedURL.js +1 -0
  70. package/dist/storage-content-api/client-uploads/generateSignedURL.js.map +1 -1
  71. package/dist/storage-content-api/generateURL.d.ts.map +1 -1
  72. package/dist/storage-content-api/generateURL.js +3 -2
  73. package/dist/storage-content-api/generateURL.js.map +1 -1
  74. package/dist/storage-content-api/handleDelete.d.ts.map +1 -1
  75. package/dist/storage-content-api/handleDelete.js +4 -2
  76. package/dist/storage-content-api/handleDelete.js.map +1 -1
  77. package/dist/storage-content-api/handleUpload.d.ts +1 -1
  78. package/dist/storage-content-api/handleUpload.d.ts.map +1 -1
  79. package/dist/storage-content-api/handleUpload.js +11 -3
  80. package/dist/storage-content-api/handleUpload.js.map +1 -1
  81. package/dist/storage-content-api/staticHandler.js +1 -0
  82. package/dist/storage-content-api/staticHandler.js.map +1 -1
  83. package/dist/utils/format-env-suffix.d.ts +12 -0
  84. package/dist/utils/format-env-suffix.d.ts.map +1 -0
  85. package/dist/utils/format-env-suffix.js +13 -0
  86. package/dist/utils/format-env-suffix.js.map +1 -0
  87. package/dist/utils/lambda-config.js +26 -12
  88. package/dist/utils/lambda-config.js.map +1 -1
  89. package/dist/utils/messages.d.ts.map +1 -1
  90. package/dist/utils/messages.js +1 -2
  91. package/dist/utils/messages.js.map +1 -1
  92. package/package.json +1 -1
  93. package/dist/db-content-api/temp-utilities/pagination.d.ts +0 -13
  94. package/dist/db-content-api/temp-utilities/pagination.d.ts.map +0 -1
  95. package/dist/db-content-api/temp-utilities/pagination.js +0 -45
  96. package/dist/db-content-api/temp-utilities/pagination.js.map +0 -1
  97. package/dist/oauth/utilities/getAdminPath.d.ts +0 -8
  98. package/dist/oauth/utilities/getAdminPath.d.ts.map +0 -1
  99. package/dist/oauth/utilities/getAdminPath.js +0 -9
  100. package/dist/oauth/utilities/getAdminPath.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/storage-content-api/staticHandler.ts"],"sourcesContent":["import type { StaticHandler } from '@payloadcms/plugin-cloud-storage/types'\nimport type { CollectionConfig } from 'payload'\n\nimport { getFilePrefix } from '@payloadcms/plugin-cloud-storage/utilities'\nimport path from 'path'\n\nimport type { StorageClient } from './client.js'\n\ntype Args = {\n client: StorageClient\n collection: CollectionConfig\n}\n\nexport const getHandler = ({ client, collection }: Args): StaticHandler => {\n return async (req, { params: { clientUploadContext, filename } }) => {\n try {\n const prefix = await getFilePrefix({ clientUploadContext, collection, filename, req })\n const key = path.posix.join(prefix, filename)\n\n const { data, error } = await client.POST('/api/v0/uploads/download/sign', {\n body: { expiresIn: 7200, filename: key },\n })\n\n if (error || !data) {\n req.payload.logger.error(`Failed to get signed download URL: ${JSON.stringify(error)}`)\n return new Response('Internal Server Error', { status: 500 })\n }\n\n // Fetch file bytes from S3 (required for Payload's image processing)\n const fileResponse = await fetch(data.url)\n\n if (!fileResponse.ok) {\n req.payload.logger.error(\n `S3 fetch failed: ${fileResponse.status} ${fileResponse.statusText}`,\n )\n return new Response('Failed to fetch file from storage', { status: 502 })\n }\n\n const contentType = fileResponse.headers.get('content-type') || 'application/octet-stream'\n const contentLength = fileResponse.headers.get('content-length')\n\n return new Response(fileResponse.body, {\n headers: {\n 'Content-Type': contentType,\n ...(contentLength && { 'Content-Length': contentLength }),\n },\n })\n } catch (err) {\n req.payload.logger.error({ err, msg: 'Error in staticHandler' })\n return new Response('Internal Server Error', { status: 500 })\n }\n }\n}\n"],"names":["getFilePrefix","path","getHandler","client","collection","req","params","clientUploadContext","filename","prefix","key","posix","join","data","error","POST","body","expiresIn","payload","logger","JSON","stringify","Response","status","fileResponse","fetch","url","ok","statusText","contentType","headers","get","contentLength","err","msg"],"mappings":"AAGA,SAASA,aAAa,QAAQ,6CAA4C;AAC1E,OAAOC,UAAU,OAAM;AASvB,OAAO,MAAMC,aAAa,CAAC,EAAEC,MAAM,EAAEC,UAAU,EAAQ;IACrD,OAAO,OAAOC,KAAK,EAAEC,QAAQ,EAAEC,mBAAmB,EAAEC,QAAQ,EAAE,E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 {"version":3,"sources":["../../src/storage-content-api/staticHandler.ts"],"sourcesContent":["import type { StaticHandler } from '@payloadcms/plugin-cloud-storage/types'\nimport type { CollectionConfig } from 'payload'\n\nimport { getFilePrefix } from '@payloadcms/plugin-cloud-storage/utilities'\nimport path from 'path'\n\nimport type { StorageClient } from './client.js'\n\ntype Args = {\n client: StorageClient\n collection: CollectionConfig\n}\n\nexport const getHandler = ({ client, collection }: Args): StaticHandler => {\n return async (req, { params: { clientUploadContext, filename } }) => {\n try {\n const prefix = await getFilePrefix({ clientUploadContext, collection, filename, req })\n const key = path.posix.join(prefix, filename)\n\n const { data, error } = await client.POST('/api/v0/uploads/download/sign', {\n body: { collectionId: collection.slug, expiresIn: 7200, filename: key },\n })\n\n if (error || !data) {\n req.payload.logger.error(`Failed to get signed download URL: ${JSON.stringify(error)}`)\n return new Response('Internal Server Error', { status: 500 })\n }\n\n // Fetch file bytes from S3 (required for Payload's image processing)\n const fileResponse = await fetch(data.url)\n\n if (!fileResponse.ok) {\n req.payload.logger.error(\n `S3 fetch failed: ${fileResponse.status} ${fileResponse.statusText}`,\n )\n return new Response('Failed to fetch file from storage', { status: 502 })\n }\n\n const contentType = fileResponse.headers.get('content-type') || 'application/octet-stream'\n const contentLength = fileResponse.headers.get('content-length')\n\n return new Response(fileResponse.body, {\n headers: {\n 'Content-Type': contentType,\n ...(contentLength && { 'Content-Length': contentLength }),\n },\n })\n } catch (err) {\n req.payload.logger.error({ err, msg: 'Error in staticHandler' })\n return new Response('Internal Server Error', { status: 500 })\n }\n }\n}\n"],"names":["getFilePrefix","path","getHandler","client","collection","req","params","clientUploadContext","filename","prefix","key","posix","join","data","error","POST","body","collectionId","slug","expiresIn","payload","logger","JSON","stringify","Response","status","fileResponse","fetch","url","ok","statusText","contentType","headers","get","contentLength","err","msg"],"mappings":"AAGA,SAASA,aAAa,QAAQ,6CAA4C;AAC1E,OAAOC,UAAU,OAAM;AASvB,OAAO,MAAMC,aAAa,CAAC,EAAEC,MAAM,EA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CAAC;gBAAEqB;gBAAKC,KAAK;YAAyB;YAC9D,OAAO,IAAIZ,SAAS,yBAAyB;gBAAEC,QAAQ;YAAI;QAC7D;IACF;AACF,EAAC"}
@@ -0,0 +1,12 @@
1
+ import type { Environment } from '../constants.js';
2
+ /**
3
+ * Format environment suffix for user-facing messages.
4
+ * Returns empty string for production (default), suffix for other environments.
5
+ *
6
+ * @param env - The environment
7
+ * @param prefix - Prefix before environment name (default: ' to ')
8
+ * @param suffix - Suffix after environment name (default: '')
9
+ * @returns Formatted string or empty string for production
10
+ */
11
+ export declare function formatEnvSuffix(env: Environment, prefix?: string, suffix?: string): string;
12
+ //# sourceMappingURL=format-env-suffix.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-env-suffix.d.ts","sourceRoot":"","sources":["../../src/utils/format-env-suffix.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAElD;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,WAAW,EAAE,MAAM,SAAS,EAAE,MAAM,SAAK,GAAG,MAAM,CAEtF"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Format environment suffix for user-facing messages.
3
+ * Returns empty string for production (default), suffix for other environments.
4
+ *
5
+ * @param env - The environment
6
+ * @param prefix - Prefix before environment name (default: ' to ')
7
+ * @param suffix - Suffix after environment name (default: '')
8
+ * @returns Formatted string or empty string for production
9
+ */ export function formatEnvSuffix(env, prefix = ' to ', suffix = '') {
10
+ return env !== 'production' ? `${prefix}${env}${suffix}` : '';
11
+ }
12
+
13
+ //# sourceMappingURL=format-env-suffix.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/format-env-suffix.ts"],"sourcesContent":["import type { Environment } from '../constants.js'\n\n/**\n * Format environment suffix for user-facing messages.\n * Returns empty string for production (default), suffix for other environments.\n *\n * @param env - The environment\n * @param prefix - Prefix before environment name (default: ' to ')\n * @param suffix - Suffix after environment name (default: '')\n * @returns Formatted string or empty string for production\n */\nexport function formatEnvSuffix(env: Environment, prefix = ' to ', suffix = ''): string {\n return env !== 'production' ? `${prefix}${env}${suffix}` : ''\n}\n"],"names":["formatEnvSuffix","env","prefix","suffix"],"mappings":"AAEA;;;;;;;;CAQC,GACD,OAAO,SAASA,gBAAgBC,GAAgB,EAAEC,SAAS,MAAM,EAAEC,SAAS,EAAE;IAC5E,OAAOF,QAAQ,eAAe,GAAGC,SAASD,MAAME,QAAQ,GAAG;AAC7D"}
@@ -17,8 +17,8 @@ NODE_ENV=production exec node server.js
17
17
  const runShPath = path.join(projectPath, 'run.sh');
18
18
  await fs.writeFile(runShPath, RUN_SH_CONTENT, 'utf-8');
19
19
  await fs.chmod(runShPath, 0o755);
20
- // 2. Modify next config to add standalone output
21
- await addStandaloneToNextConfig(projectPath);
20
+ // 2. Modify next config to add standalone output and eslint ignore
21
+ await addNextConfigProperties(projectPath);
22
22
  // 3. Create/update .npmrc
23
23
  const npmrcPath = path.join(projectPath, '.npmrc');
24
24
  let npmrcContent = '';
@@ -56,13 +56,18 @@ NODE_ENV=production exec node server.js
56
56
  throw new Error('Could not find next.config.js or next.config.mjs');
57
57
  }
58
58
  /**
59
- * Add standalone output to Next.js config using AST parsing
60
- */ async function addStandaloneToNextConfig(projectPath) {
59
+ * Add required Next.js config properties using AST parsing
60
+ * - output: 'standalone' (for Lambda deployment)
61
+ * - eslint: { ignoreDuringBuilds: true } (allow builds with lint errors)
62
+ */ async function addNextConfigProperties(projectPath) {
61
63
  const nextConfigPath = await findNextConfigPath(projectPath);
62
64
  const content = await fs.readFile(nextConfigPath, 'utf-8');
63
- // Check if output already configured (quick check before parsing)
64
- if (content.includes('output:')) {
65
- return; // Already configured
65
+ // Check which properties already exist
66
+ const hasOutput = content.includes('output:');
67
+ const hasEslint = content.includes('eslint:');
68
+ // Early exit if both already configured
69
+ if (hasOutput && hasEslint) {
70
+ return;
66
71
  }
67
72
  const ast = parseModule(content, {
68
73
  loc: true
@@ -104,16 +109,25 @@ NODE_ENV=production exec node server.js
104
109
  }
105
110
  const { loc } = targetObjectExpression;
106
111
  const lines = content.split(/\r?\n/);
107
- // Insert output: 'standalone' as first property
112
+ // Build insertion string based on what's missing
113
+ const parts = [];
114
+ if (!hasOutput) {
115
+ parts.push("output: 'standalone',");
116
+ }
117
+ if (!hasEslint) {
118
+ parts.push(`eslint: {
119
+ ignoreDuringBuilds: true,
120
+ },`);
121
+ }
122
+ const insertString = '\n ' + parts.join('\n ');
123
+ // Insert after opening brace
108
124
  const insertLine = loc.start.line - 1;
109
- const insertColumn = loc.start.column + 1 // After opening brace
110
- ;
111
- // Find the content of the line with the opening brace
125
+ const insertColumn = loc.start.column + 1;
112
126
  const targetLine = lines[insertLine];
113
127
  if (!targetLine) {
114
128
  throw new Error(`Could not find target line in ${path.basename(nextConfigPath)}`);
115
129
  }
116
- lines[insertLine] = targetLine.slice(0, insertColumn) + "\n output: 'standalone'," + targetLine.slice(insertColumn);
130
+ lines[insertLine] = targetLine.slice(0, insertColumn) + insertString + targetLine.slice(insertColumn);
117
131
  const modifiedContent = lines.join('\n');
118
132
  await fs.writeFile(nextConfigPath, modifiedContent, 'utf-8');
119
133
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/lambda-config.ts"],"sourcesContent":["import { parseModule, Syntax } from 'esprima-next'\nimport fs from 'fs/promises'\nimport path from 'path'\n\nimport type { PackageManager } from './package-manager.js'\n\nconst RUN_SH_CONTENT = `#!/bin/bash -x\n\n[ ! -d '/tmp/cache' ] && mkdir -p /tmp/cache\n\nNODE_ENV=production exec node server.js\n`\n\n/**\n * Apply Lambda-specific modifications to a Payload project\n *\n * @param projectPath - Path to project directory\n * @param packageManager - Package manager to use in scripts (defaults to 'pnpm')\n */\nexport async function applyLambdaModifications(\n projectPath: string,\n packageManager: PackageManager = 'pnpm',\n): Promise<void> {\n // 1. Create run.sh\n const runShPath = path.join(projectPath, 'run.sh')\n await fs.writeFile(runShPath, RUN_SH_CONTENT, 'utf-8')\n await fs.chmod(runShPath, 0o755)\n\n // 2. Modify next config to add standalone output\n await addStandaloneToNextConfig(projectPath)\n\n // 3. Create/update .npmrc\n const npmrcPath = path.join(projectPath, '.npmrc')\n let npmrcContent = ''\n\n try {\n npmrcContent = await fs.readFile(npmrcPath, 'utf-8')\n } catch {\n // File doesn't exist, start fresh\n }\n\n if (!npmrcContent.includes('node-linker=hoisted')) {\n npmrcContent += npmrcContent && !npmrcContent.endsWith('\\n') ? '\\n' : ''\n npmrcContent += 'node-linker=hoisted\\n'\n await fs.writeFile(npmrcPath, npmrcContent, 'utf-8')\n }\n\n // 4. Add lambda:buildzip script to package.json\n await addLambdaBuildScript(projectPath, packageManager)\n}\n\n/**\n * Find the Next.js config file (next.config.js or next.config.mjs)\n *\n * @todo Support TypeScript config files in future\n */\nasync function findNextConfigPath(projectPath: string): Promise<string> {\n const configFiles = ['next.config.js', 'next.config.mjs']\n\n for (const configFile of configFiles) {\n const configPath = path.join(projectPath, configFile)\n try {\n await fs.access(configPath)\n return configPath\n } catch {\n // File doesn't exist, try next one\n }\n }\n\n throw new Error('Could not find next.config.js or next.config.mjs')\n}\n\n/**\n * Add standalone output to Next.js config using AST parsing\n */\nasync function addStandaloneToNextConfig(projectPath: string): Promise<void> {\n const nextConfigPath = await findNextConfigPath(projectPath)\n const content = await fs.readFile(nextConfigPath, 'utf-8')\n\n // Check if output already configured (quick check before parsing)\n if (content.includes('output:')) {\n return // Already configured\n }\n\n const ast = parseModule(content, { loc: true })\n\n // Find export default declaration\n const exportDefaultDeclaration = ast.body.find(\n (p) => p.type === Syntax.ExportDefaultDeclaration,\n ) as ExportDefaultDeclaration | undefined\n\n if (!exportDefaultDeclaration?.declaration?.loc) {\n throw new Error(`Could not find export default declaration in ${path.basename(nextConfigPath)}`)\n }\n\n // Find the object expression to modify\n let targetObjectExpression: ObjectExpressionNode | undefined\n\n if (exportDefaultDeclaration.declaration.type === 'ObjectExpression') {\n // Direct export: export default { ... }\n targetObjectExpression = exportDefaultDeclaration.declaration as ObjectExpressionNode\n } else if (exportDefaultDeclaration.declaration.type === 'CallExpression') {\n // Wrapped export: export default withPayload(nextConfig, ...)\n const callExpr = exportDefaultDeclaration.declaration as CallExpressionNode\n const firstArg = callExpr.arguments?.[0]\n\n if (firstArg?.type === 'Identifier') {\n // Find the variable declaration for this identifier\n const configVarName = (firstArg as IdentifierNode).name\n const varDeclaration = ast.body.find((node) => {\n if (node.type === Syntax.VariableDeclaration) {\n const varNode = node as VariableDeclarationNode\n return varNode.declarations?.some(\n (decl) =>\n decl.id?.type === 'Identifier' &&\n (decl.id as IdentifierNode).name === configVarName &&\n decl.init?.type === 'ObjectExpression',\n )\n }\n return false\n }) as undefined | VariableDeclarationNode\n\n if (varDeclaration) {\n const declarator = varDeclaration.declarations?.find(\n (decl) =>\n decl.id?.type === 'Identifier' && (decl.id as IdentifierNode).name === configVarName,\n )\n if (declarator?.init?.type === 'ObjectExpression') {\n targetObjectExpression = declarator.init as ObjectExpressionNode\n }\n }\n }\n }\n\n if (!targetObjectExpression?.loc) {\n throw new Error(\n `Could not find Next.js config object in ${path.basename(nextConfigPath)}. ` +\n `Expected either 'export default { ... }' or 'export default wrapper(configVar, ...)'`,\n )\n }\n\n const { loc } = targetObjectExpression\n const lines = content.split(/\\r?\\n/)\n\n // Insert output: 'standalone' as first property\n const insertLine = loc.start.line - 1\n const insertColumn = loc.start.column + 1 // After opening brace\n\n // Find the content of the line with the opening brace\n const targetLine = lines[insertLine]\n if (!targetLine) {\n throw new Error(`Could not find target line in ${path.basename(nextConfigPath)}`)\n }\n\n lines[insertLine] =\n targetLine.slice(0, insertColumn) + \"\\n output: 'standalone',\" + targetLine.slice(insertColumn)\n\n const modifiedContent = lines.join('\\n')\n await fs.writeFile(nextConfigPath, modifiedContent, 'utf-8')\n}\n\ntype ExportDefaultDeclaration = {\n declaration: {\n arguments?: unknown[]\n loc: {\n end: { column: number; line: number }\n start: { column: number; line: number }\n }\n type: string\n }\n type: string\n}\n\ntype ObjectExpressionNode = {\n loc: {\n end: { column: number; line: number }\n start: { column: number; line: number }\n }\n type: 'ObjectExpression'\n}\n\ntype IdentifierNode = {\n name: string\n type: 'Identifier'\n}\n\ntype CallExpressionNode = {\n arguments?: Array<{ type: string }>\n type: 'CallExpression'\n}\n\ntype VariableDeclarationNode = {\n declarations?: Array<{\n id?: { name?: string; type: string }\n init?: { loc?: ObjectExpressionNode['loc']; type: string }\n }>\n type: 'VariableDeclaration'\n}\n\n/**\n * Add lambda:buildzip script to package.json\n */\nasync function addLambdaBuildScript(\n projectPath: string,\n packageManager: PackageManager,\n): Promise<void> {\n const packageJsonPath = path.join(projectPath, 'package.json')\n const content = await fs.readFile(packageJsonPath, 'utf-8')\n const packageJson = JSON.parse(content)\n\n if (!packageJson.scripts) {\n packageJson.scripts = {}\n }\n\n // Use package manager's run and exec commands\n const runCmd = packageManager === 'npm' ? 'npm run' : packageManager\n const execCmd = packageManager === 'npm' ? 'npx' : `${packageManager} exec`\n\n packageJson.scripts['lambda:buildzip'] =\n `${runCmd} build && ${execCmd} payloadcms-figma build-lambda-zip`\n\n await fs.writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2) + '\\n', 'utf-8')\n}\n"],"names":["parseModule","Syntax","fs","path","RUN_SH_CONTENT","applyLambdaModifications","projectPath","packageManager","runShPath","join","writeFile","chmod","addStandaloneToNextConfig","npmrcPath","npmrcContent","readFile","includes","endsWith","addLambdaBuildScript","findNextConfigPath","configFiles","configFile","configPath","access","Error","nextConfigPath","content","ast","loc","exportDefaultDeclaration","body","find","p","type","ExportDefaultDeclaration","declaration","basename","targetObjectExpression","callExpr","firstArg","arguments","configVarName","name","varDeclaration","node","VariableDeclaration","varNode","declarations","some","decl","id","init","declarator","lines","split","insertLine","start","line","insertColumn","column","targetLine","slice","modifiedContent","packageJsonPath","packageJson","JSON","parse","scripts","runCmd","execCmd","stringify"],"mappings":"AAAA,SAASA,WAAW,EAAEC,MAAM,QAAQ,e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D,UAAU9D,mBAAmB,QAAQ,QAAQ,GAAGA,eAAe,KAAK,CAAC;IAE3EyD,YAAYG,OAAO,CAAC,kBAAkB,GACpC,GAAGC,OAAO,UAAU,EAAEC,QAAQ,kCAAkC,CAAC;IAEnE,MAAMnE,GAAGQ,SAAS,CAACqD,iBAAiBE,KAAKK,SAAS,CAACN,aAAa,MAAM,KAAK,MAAM;AACnF"}
1
+ {"version":3,"sources":["../../src/utils/lambda-config.ts"],"sourcesContent":["import { parseModule, Syntax } from 'esprima-next'\nimport fs from 'fs/promises'\nimport path from 'path'\n\nimport type { PackageManager } from './package-manager.js'\n\nconst RUN_SH_CONTENT = `#!/bin/bash -x\n\n[ ! -d '/tmp/cache' ] && mkdir -p /tmp/cache\n\nNODE_ENV=production exec node server.js\n`\n\n/**\n * Apply Lambda-specific modifications to a Payload project\n *\n * @param projectPath - Path to project directory\n * @param packageManager - Package manager to use in scripts (defaults to 'pnpm')\n */\nexport async function applyLambdaModifications(\n projectPath: string,\n packageManager: PackageManager = 'pnpm',\n): Promise<void> {\n // 1. Create run.sh\n const runShPath = path.join(projectPath, 'run.sh')\n await fs.writeFile(runShPath, RUN_SH_CONTENT, 'utf-8')\n await fs.chmod(runShPath, 0o755)\n\n // 2. Modify next config to add standalone output and eslint ignore\n await addNextConfigProperties(projectPath)\n\n // 3. Create/update .npmrc\n const npmrcPath = path.join(projectPath, '.npmrc')\n let npmrcContent = ''\n\n try {\n npmrcContent = await fs.readFile(npmrcPath, 'utf-8')\n } catch {\n // File doesn't exist, start fresh\n }\n\n if (!npmrcContent.includes('node-linker=hoisted')) {\n npmrcContent += npmrcContent && !npmrcContent.endsWith('\\n') ? '\\n' : ''\n npmrcContent += 'node-linker=hoisted\\n'\n await fs.writeFile(npmrcPath, npmrcContent, 'utf-8')\n }\n\n // 4. Add lambda:buildzip script to package.json\n await addLambdaBuildScript(projectPath, packageManager)\n}\n\n/**\n * Find the Next.js config file (next.config.js or next.config.mjs)\n *\n * @todo Support TypeScript config files in future\n */\nasync function findNextConfigPath(projectPath: string): Promise<string> {\n const configFiles = ['next.config.js', 'next.config.mjs']\n\n for (const configFile of configFiles) {\n const configPath = path.join(projectPath, configFile)\n try {\n await fs.access(configPath)\n return configPath\n } catch {\n // File doesn't exist, try next one\n }\n }\n\n throw new Error('Could not find next.config.js or next.config.mjs')\n}\n\n/**\n * Add required Next.js config properties using AST parsing\n * - output: 'standalone' (for Lambda deployment)\n * - eslint: { ignoreDuringBuilds: true } (allow builds with lint errors)\n */\nasync function addNextConfigProperties(projectPath: string): Promise<void> {\n const nextConfigPath = await findNextConfigPath(projectPath)\n const content = await fs.readFile(nextConfigPath, 'utf-8')\n\n // Check which properties already exist\n const hasOutput = content.includes('output:')\n const hasEslint = content.includes('eslint:')\n\n // Early exit if both already configured\n if (hasOutput && hasEslint) {\n return\n }\n\n const ast = parseModule(content, { loc: true })\n\n // Find export default declaration\n const exportDefaultDeclaration = ast.body.find(\n (p) => p.type === Syntax.ExportDefaultDeclaration,\n ) as ExportDefaultDeclaration | undefined\n\n if (!exportDefaultDeclaration?.declaration?.loc) {\n throw new Error(`Could not find export default declaration in ${path.basename(nextConfigPath)}`)\n }\n\n // Find the object expression to modify\n let targetObjectExpression: ObjectExpressionNode | undefined\n\n if (exportDefaultDeclaration.declaration.type === 'ObjectExpression') {\n // Direct export: export default { ... }\n targetObjectExpression = exportDefaultDeclaration.declaration as ObjectExpressionNode\n } else if (exportDefaultDeclaration.declaration.type === 'CallExpression') {\n // Wrapped export: export default withPayload(nextConfig, ...)\n const callExpr = exportDefaultDeclaration.declaration as CallExpressionNode\n const firstArg = callExpr.arguments?.[0]\n\n if (firstArg?.type === 'Identifier') {\n // Find the variable declaration for this identifier\n const configVarName = (firstArg as IdentifierNode).name\n const varDeclaration = ast.body.find((node) => {\n if (node.type === Syntax.VariableDeclaration) {\n const varNode = node as VariableDeclarationNode\n return varNode.declarations?.some(\n (decl) =>\n decl.id?.type === 'Identifier' &&\n (decl.id as IdentifierNode).name === configVarName &&\n decl.init?.type === 'ObjectExpression',\n )\n }\n return false\n }) as undefined | VariableDeclarationNode\n\n if (varDeclaration) {\n const declarator = varDeclaration.declarations?.find(\n (decl) =>\n decl.id?.type === 'Identifier' && (decl.id as IdentifierNode).name === configVarName,\n )\n if (declarator?.init?.type === 'ObjectExpression') {\n targetObjectExpression = declarator.init as ObjectExpressionNode\n }\n }\n }\n }\n\n if (!targetObjectExpression?.loc) {\n throw new Error(\n `Could not find Next.js config object in ${path.basename(nextConfigPath)}. ` +\n `Expected either 'export default { ... }' or 'export default wrapper(configVar, ...)'`,\n )\n }\n\n const { loc } = targetObjectExpression\n const lines = content.split(/\\r?\\n/)\n\n // Build insertion string based on what's missing\n const parts: string[] = []\n if (!hasOutput) {\n parts.push(\"output: 'standalone',\")\n }\n if (!hasEslint) {\n parts.push(`eslint: {\n ignoreDuringBuilds: true,\n },`)\n }\n\n const insertString = '\\n ' + parts.join('\\n ')\n\n // Insert after opening brace\n const insertLine = loc.start.line - 1\n const insertColumn = loc.start.column + 1\n\n const targetLine = lines[insertLine]\n if (!targetLine) {\n throw new Error(`Could not find target line in ${path.basename(nextConfigPath)}`)\n }\n\n lines[insertLine] =\n targetLine.slice(0, insertColumn) + insertString + targetLine.slice(insertColumn)\n\n const modifiedContent = lines.join('\\n')\n await fs.writeFile(nextConfigPath, modifiedContent, 'utf-8')\n}\n\ntype ExportDefaultDeclaration = {\n declaration: {\n arguments?: unknown[]\n loc: {\n end: { column: number; line: number }\n start: { column: number; line: number }\n }\n type: string\n }\n type: string\n}\n\ntype ObjectExpressionNode = {\n loc: {\n end: { column: number; line: number }\n start: { column: number; line: number }\n }\n type: 'ObjectExpression'\n}\n\ntype IdentifierNode = {\n name: string\n type: 'Identifier'\n}\n\ntype CallExpressionNode = {\n arguments?: Array<{ type: string }>\n type: 'CallExpression'\n}\n\ntype VariableDeclarationNode = {\n declarations?: Array<{\n id?: { name?: string; type: string }\n init?: { loc?: ObjectExpressionNode['loc']; type: string }\n }>\n type: 'VariableDeclaration'\n}\n\n/**\n * Add lambda:buildzip script to package.json\n */\nasync function addLambdaBuildScript(\n projectPath: string,\n packageManager: PackageManager,\n): Promise<void> {\n const packageJsonPath = path.join(projectPath, 'package.json')\n const content = await fs.readFile(packageJsonPath, 'utf-8')\n const packageJson = JSON.parse(content)\n\n if (!packageJson.scripts) {\n packageJson.scripts = {}\n }\n\n // Use package manager's run and exec commands\n const runCmd = packageManager === 'npm' ? 'npm run' : packageManager\n const execCmd = packageManager === 'npm' ? 'npx' : `${packageManager} exec`\n\n packageJson.scripts['lambda:buildzip'] =\n `${runCmd} build && ${execCmd} payloadcms-figma build-lambda-zip`\n\n await fs.writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2) + '\\n', 'utf-8')\n}\n"],"names":["parseModule","Syntax","fs","path","RUN_SH_CONTENT","applyLambdaModifications","projectPath","packageManager","runShPath","join","writeFile","chmod","addNextConfigProperties","npmrcPath","npmrcContent","readFile","includes","endsWith","addLambdaBuildScript","findNextConfigPath","configFiles","configFile","configPath","access","Error","nextConfigPath","content","hasOutput","hasEslint","ast","loc","exportDefaultDeclaration","body","find","p","type","ExportDefaultDeclaration","declaration","basename","targetObjectExpression","callExpr","firstArg","arguments","configVarName","name","varDeclaration","node","VariableDeclaration","varNode","declarations","some","decl","id","init","declarator","lines","split","parts","push","insertString","insertLine","start","line","insertColumn","column","targetLine","slice","modifiedContent","packageJsonPath","packageJson","JSON","parse","scripts","runCmd","execCmd","stringify"],"mappings":"AAAA,SAASA,WAAW,EAAEC,MAAM,QAAQ,eAAc;AAClD,OAAOC,QAAQ,cAAa;AAC5B,OAAOC,UAAU,OAAM;AAIvB,MAAMC,iBAAiB,CAAC;;;;;AAKxB,CAAC;AAED;;;;;CAKC,GACD,OAAO,eAAeC,yBACpBC,WAAmB,EACnBC,iBAAiC,MAAM;IAEvC,mBAAmB;IACnB,MAAMC,YAAYL,KAAKM,IAAI,CAACH,aAAa;IACzC,MAAMJ,GAAGQ,SAAS,CA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nE,mBAAmB,QAAQ,QAAQ,GAAGA,eAAe,KAAK,CAAC;IAE3E8D,YAAYG,OAAO,CAAC,kBAAkB,GACpC,GAAGC,OAAO,UAAU,EAAEC,QAAQ,kCAAkC,CAAC;IAEnE,MAAMxE,GAAGQ,SAAS,CAAC0D,iBAAiBE,KAAKK,SAAS,CAACN,aAAa,MAAM,KAAK,MAAM;AACnF"}
@@ -1 +1 @@
1
- {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/utils/messages.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAIjD,wBAAgB,WAAW,IAAI,IAAI,CA4ClC;AASD,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE,cAAc,GAAG,MAAM,CAiBzF;AAED,wBAAgB,kBAAkB,IAAI,MAAM,CAO3C;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAgBpF;AAED,wBAAgB,aAAa,IAAI,MAAM,CAEtC"}
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/utils/messages.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAIjD,wBAAgB,WAAW,IAAI,IAAI,CA2ClC;AASD,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE,cAAc,GAAG,MAAM,CAiBzF;AAED,wBAAgB,kBAAkB,IAAI,MAAM,CAO3C;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAgBpF;AAED,wBAAgB,aAAa,IAAI,MAAM,CAEtC"}
@@ -22,12 +22,11 @@ export function helpMessage() {
22
22
  ${pc.dim('-h, --help Show help')}
23
23
  ${pc.dim('-v, --version Show CLI version')}
24
24
  ${pc.dim('--debug Enable debug logging')}
25
- ${pc.dim('--env <env> Set environment: prod or staging')}
26
25
 
27
26
  ${pc.bold('AUTHENTICATION')}
28
27
 
29
28
  ${pc.cyan('@payloadcms/figma login')} Authenticate with Figma
30
- ${pc.cyan('@payloadcms/figma logout')} Clear all tokens (with confirmation)
29
+ ${pc.cyan('@payloadcms/figma logout')} Clear tokens for current environment
31
30
  ${pc.cyan('@payloadcms/figma list-tokens')} Display stored OAuth and project tokens
32
31
 
33
32
  ${pc.bold('INIT COMMAND')}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/messages.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport path from 'path'\nimport pc from 'picocolors'\nimport terminalLink from 'terminal-link'\n\nimport type { PackageManager } from '../types.js'\n\nconst header = (message: string): string => pc.bold(message)\n\nexport function helpMessage(): void {\n console.log(`\n ${pc.bold('USAGE')}\n\n ${pc.dim('@payloadcms/figma <command> [options]')}\n\n ${pc.bold('COMMANDS')}\n\n ${pc.cyan('login')} Authenticate with Figma OAuth2\n ${pc.cyan('logout')} Clear all stored tokens\n ${pc.cyan('list-tokens')} Show stored token information\n ${pc.cyan('init')} Initialize a Figma CMS project\n ${pc.cyan('deploy')} Deploy your project to Figma\n ${pc.cyan('build-lambda-zip')} Build Lambda deployment zip\n\n ${pc.bold('OPTIONS')}\n\n ${pc.dim('-h, --help Show help')}\n ${pc.dim('-v, --version Show CLI version')}\n ${pc.dim('--debug Enable debug logging')}\n ${pc.dim('--env <env> Set environment: prod or staging')}\n\n ${pc.bold('AUTHENTICATION')}\n\n ${pc.cyan('@payloadcms/figma login')} Authenticate with Figma\n ${pc.cyan('@payloadcms/figma logout')} Clear all tokens (with confirmation)\n ${pc.cyan('@payloadcms/figma list-tokens')} Display stored OAuth and project tokens\n\n ${pc.bold('INIT COMMAND')}\n\n ${pc.cyan('@payloadcms/figma init --id <content-system-id>')} Initialize project with Content System ID\n ${pc.cyan('@payloadcms/figma init --force')} Force reconfiguration of existing project\n\n ${pc.bold('DEPLOY COMMAND')}\n\n ${pc.cyan('@payloadcms/figma deploy')} Deploy your project to Figma\n ${pc.dim('--yes, -y')} Skip confirmation prompts\n ${pc.dim('--skip-build')} Skip building and use existing build\n\n ${pc.bold('DOCUMENTATION')}\n\n ${createTerminalLink('Getting Started', 'https://payloadcms.com/docs/getting-started/what-is-payload')}\n ${createTerminalLink('Figma CMS Docs', 'https://www.figma.com/developers/api')}\n`)\n}\n\n// Create terminalLink with fallback for unsupported terminals\nfunction createTerminalLink(text: string, url: string) {\n return terminalLink(text, url, {\n fallback: (text, url) => `${text}: ${url}`,\n })\n}\n\nexport function successMessage(projectDir: string, packageManager: PackageManager): string {\n const relativePath = path.relative(process.cwd(), projectDir)\n return `\n${header('Launch Application:')}\n\n - cd ./${relativePath}\n - ${packageManager === 'npm' ? 'npm run' : packageManager} dev or follow directions in README.md\n\n${header('Documentation:')}\n\n - ${createTerminalLink(\n 'Getting Started',\n 'https://payloadcms.com/docs/getting-started/what-is-payload',\n )}\n - ${createTerminalLink('Configuration', 'https://payloadcms.com/docs/configuration/overview')}\n\n`\n}\n\nexport function successfulNextInit(): string {\n return `- ${createTerminalLink(\n 'Getting Started',\n 'https://payloadcms.com/docs/getting-started/what-is-payload',\n )}\n- ${createTerminalLink('Configuration', 'https://payloadcms.com/docs/configuration/overview')}\n`\n}\n\nexport function moveMessage(args: { nextAppDir: string; projectDir: string }): string {\n const relativeAppDir = path.relative(process.cwd(), args.nextAppDir)\n return `\n${header('Next Steps:')}\n\nPayload does not support a top-level layout.tsx file in the app directory.\n\n${pc.bold('To continue:')}\n\n- Create a new directory in ./${relativeAppDir} such as ./${relativeAppDir}/${pc.bold('(app)')}\n- Move all files from ./${relativeAppDir} into that directory\n\nIt is recommended to do this from your IDE if your app has existing file references.\n\nOnce moved, rerun the @payloadcms/figma command again.\n`\n}\n\nexport function feedbackOutro(): string {\n return `${pc.bgCyan(pc.black(' Have feedback? '))} Visit us on ${createTerminalLink('GitHub', 'https://github.com/payloadcms/payload')}.`\n}\n"],"names":["path","pc","terminalLink","header","message","bold","helpMessage","console","log","dim","cyan","createTerminalLink","text","url","fallback","successMessage","projectDir","packageManager","relativePath","relative","process","cwd","successfulNextInit","moveMessage","args","relativeAppDir","nextAppDir","feedbackOutro","bgCyan","black"],"mappings":"AAAA,6BAA6B,GAC7B,OAAOA,UAAU,OAAM;AACvB,OAAOC,QAAQ,aAAY;AAC3B,OAAOC,kBAAkB,gBAAe;AAIxC,MAAMC,SAAS,CAACC,UAA4BH,GAAGI,IAAI,CAACD;AAEpD,OAAO,SAASE;IACdC,QAAQC,GAAG,CAAC,CAAC;EACb,EAAEP,GAAGI,IAAI,CAAC,SAAS;;MAEf,EAAEJ,GAAGQ,GAAG,CAAC,yCAAyC;;EAEtD,EAAER,GAAGI,IAAI,CAAC,YAAY;;MAElB,EAAEJ,GAAGS,IAAI,CAAC,SAAS;MACnB,EAAET,GAAGS,IAAI,CAAC,UAAU;MACpB,EAAET,GAAGS,IAAI,CAAC,eAAe;MACzB,EAAET,GAAGS,IAAI,CAAC,QAAQ;MAClB,EAAET,GAAGS,IAAI,CAAC,UAAU;MACpB,EAAET,GAAGS,IAAI,CAAC,oBAAoB;;EAElC,EAAET,GAAGI,IAAI,CAAC,WAAW;;MAEjB,EAAEJ,GAAGQ,GAAG,CAAC,iCAAiC;MAC1C,EAAER,GAAGQ,GAAG,CAAC,wCAAwC;MACjD,EAAER,GAAGQ,GAAG,CAAC,4CAA4C;MACrD,EAAER,GAAGQ,GAAG,CAAC,wDAAwD;;EAErE,EAAER,GAAGI,IAAI,CAAC,kBAAkB;;MAExB,EAAEJ,GAAGS,IAAI,CAAC,2BAA2B;MACrC,EAAET,GAAGS,IAAI,CAAC,4BAA4B;MACtC,EAAET,GAAGS,IAAI,CAAC,iCAAiC;;EAE/C,EAAET,GAAGI,IAAI,CAAC,gBAAgB;;MAEtB,EAAEJ,GAAG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EA,eAAe,CAAC,EAAExB,GAAGI,IAAI,CAAC,SAAS;wBACvE,EAAEoB,eAAe;;;;;AAKzC,CAAC;AACD;AAEA,OAAO,SAASE;IACd,OAAO,GAAG1B,GAAG2B,MAAM,CAAC3B,GAAG4B,KAAK,CAAC,qBAAqB,aAAa,EAAElB,mBAAmB,UAAU,yCAAyC,CAAC,CAAC;AAC3I"}
1
+ {"version":3,"sources":["../../src/utils/messages.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport path from 'path'\nimport pc from 'picocolors'\nimport terminalLink from 'terminal-link'\n\nimport type { PackageManager } from '../types.js'\n\nconst header = (message: string): string => pc.bold(message)\n\nexport function helpMessage(): void {\n console.log(`\n ${pc.bold('USAGE')}\n\n ${pc.dim('@payloadcms/figma <command> [options]')}\n\n ${pc.bold('COMMANDS')}\n\n ${pc.cyan('login')} Authenticate with Figma OAuth2\n ${pc.cyan('logout')} Clear all stored tokens\n ${pc.cyan('list-tokens')} Show stored token information\n ${pc.cyan('init')} Initialize a Figma CMS project\n ${pc.cyan('deploy')} Deploy your project to Figma\n ${pc.cyan('build-lambda-zip')} Build Lambda deployment zip\n\n ${pc.bold('OPTIONS')}\n\n ${pc.dim('-h, --help Show help')}\n ${pc.dim('-v, --version Show CLI version')}\n ${pc.dim('--debug Enable debug logging')}\n\n ${pc.bold('AUTHENTICATION')}\n\n ${pc.cyan('@payloadcms/figma login')} Authenticate with Figma\n ${pc.cyan('@payloadcms/figma logout')} Clear tokens for current environment\n ${pc.cyan('@payloadcms/figma list-tokens')} Display stored OAuth and project tokens\n\n ${pc.bold('INIT COMMAND')}\n\n ${pc.cyan('@payloadcms/figma init --id <content-system-id>')} Initialize project with Content System ID\n ${pc.cyan('@payloadcms/figma init --force')} Force reconfiguration of existing project\n\n ${pc.bold('DEPLOY COMMAND')}\n\n ${pc.cyan('@payloadcms/figma deploy')} Deploy your project to Figma\n ${pc.dim('--yes, -y')} Skip confirmation prompts\n ${pc.dim('--skip-build')} Skip building and use existing build\n\n ${pc.bold('DOCUMENTATION')}\n\n ${createTerminalLink('Getting Started', 'https://payloadcms.com/docs/getting-started/what-is-payload')}\n ${createTerminalLink('Figma CMS Docs', 'https://www.figma.com/developers/api')}\n`)\n}\n\n// Create terminalLink with fallback for unsupported terminals\nfunction createTerminalLink(text: string, url: string) {\n return terminalLink(text, url, {\n fallback: (text, url) => `${text}: ${url}`,\n })\n}\n\nexport function successMessage(projectDir: string, packageManager: PackageManager): string {\n const relativePath = path.relative(process.cwd(), projectDir)\n return `\n${header('Launch Application:')}\n\n - cd ./${relativePath}\n - ${packageManager === 'npm' ? 'npm run' : packageManager} dev or follow directions in README.md\n\n${header('Documentation:')}\n\n - ${createTerminalLink(\n 'Getting Started',\n 'https://payloadcms.com/docs/getting-started/what-is-payload',\n )}\n - ${createTerminalLink('Configuration', 'https://payloadcms.com/docs/configuration/overview')}\n\n`\n}\n\nexport function successfulNextInit(): string {\n return `- ${createTerminalLink(\n 'Getting Started',\n 'https://payloadcms.com/docs/getting-started/what-is-payload',\n )}\n- ${createTerminalLink('Configuration', 'https://payloadcms.com/docs/configuration/overview')}\n`\n}\n\nexport function moveMessage(args: { nextAppDir: string; projectDir: string }): string {\n const relativeAppDir = path.relative(process.cwd(), args.nextAppDir)\n return `\n${header('Next Steps:')}\n\nPayload does not support a top-level layout.tsx file in the app directory.\n\n${pc.bold('To continue:')}\n\n- Create a new directory in ./${relativeAppDir} such as ./${relativeAppDir}/${pc.bold('(app)')}\n- Move all files from ./${relativeAppDir} into that directory\n\nIt is recommended to do this from your IDE if your app has existing file references.\n\nOnce moved, rerun the @payloadcms/figma command again.\n`\n}\n\nexport function feedbackOutro(): string {\n return `${pc.bgCyan(pc.black(' Have feedback? '))} Visit us on ${createTerminalLink('GitHub', 'https://github.com/payloadcms/payload')}.`\n}\n"],"names":["path","pc","terminalLink","header","message","bold","helpMessage","console","log","dim","cyan","createTerminalLink","text","url","fallback","successMessage","projectDir","packageManager","relativePath","relative","process","cwd","successfulNextInit","mo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C;AAC3I"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@payloadcms/figma",
3
- "version": "0.0.1-alpha.41",
3
+ "version": "0.0.1-alpha.42",
4
4
  "license": "SEE LICENSE IN LICENSE.md",
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,13 +0,0 @@
1
- import type { components } from '../generated/content-api-types.js';
2
- export declare const getPaginationData: (contentAPIPagination: components["schemas"]["Pagination"], pagination?: boolean) => {
3
- hasNextPage: boolean;
4
- hasPrevPage: boolean;
5
- limit: number;
6
- nextPage: number | null;
7
- page: number;
8
- pagingCounter: number;
9
- prevPage: number | null;
10
- totalDocs: number;
11
- totalPages: number;
12
- };
13
- //# sourceMappingURL=pagination.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../../src/db-content-api/temp-utilities/pagination.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AA6BnE,eAAO,MAAM,iBAAiB,yBACN,UAAU,CAAC,SAAS,CAAC,CAAC,YAAY,CAAC,eAC5C,OAAO;;;;;;;;;;CAiBrB,CAAA"}
@@ -1,45 +0,0 @@
1
- // Convert Content API pagination response to Payload's expected format
2
- // Content API already calculates next/prev pages, we just need to transform the structure
3
- //
4
- // Content API format (nested):
5
- // {
6
- // data: [...],
7
- // pagination: {
8
- // total: 100,
9
- // current: { limit: 10, page: 2 },
10
- // next: { limit: 10, page: 3 },
11
- // prev: { limit: 10, page: 1 }
12
- // }
13
- // }
14
- //
15
- // Payload format (flat):
16
- // {
17
- // docs: [...],
18
- // hasNextPage: true,
19
- // hasPrevPage: true,
20
- // limit: 10,
21
- // nextPage: 3,
22
- // page: 2,
23
- // pagingCounter: 11,
24
- // prevPage: 1,
25
- // totalDocs: 100,
26
- // totalPages: 10
27
- // }
28
- export const getPaginationData = (contentAPIPagination, pagination)=>{
29
- const { current, next, prev, total } = contentAPIPagination;
30
- const hasNextPage = pagination !== false && next !== undefined;
31
- const hasPrevPage = pagination !== false && prev !== undefined;
32
- return {
33
- hasNextPage,
34
- hasPrevPage,
35
- limit: current.limit,
36
- nextPage: next?.page ?? null,
37
- page: current.page,
38
- pagingCounter: (current.page - 1) * current.limit + 1,
39
- prevPage: prev?.page ?? null,
40
- totalDocs: total,
41
- totalPages: current.limit > 0 ? Math.ceil(total / current.limit) : 1
42
- };
43
- };
44
-
45
- //# sourceMappingURL=pagination.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/db-content-api/temp-utilities/pagination.ts"],"sourcesContent":["import type { components } from '../generated/content-api-types.js'\n\n// Convert Content API pagination response to Payload's expected format\n// Content API already calculates next/prev pages, we just need to transform the structure\n//\n// Content API format (nested):\n// {\n// data: [...],\n// pagination: {\n// total: 100,\n// current: { limit: 10, page: 2 },\n// next: { limit: 10, page: 3 },\n// prev: { limit: 10, page: 1 }\n// }\n// }\n//\n// Payload format (flat):\n// {\n// docs: [...],\n// hasNextPage: true,\n// hasPrevPage: true,\n// limit: 10,\n// nextPage: 3,\n// page: 2,\n// pagingCounter: 11,\n// prevPage: 1,\n// totalDocs: 100,\n// totalPages: 10\n// }\nexport const getPaginationData = (\n contentAPIPagination: components['schemas']['Pagination'],\n pagination?: boolean,\n) => {\n const { current, next, prev, total } = contentAPIPagination\n const hasNextPage = pagination !== false && next !== undefined\n const hasPrevPage = pagination !== false && prev !== undefined\n\n return {\n hasNextPage,\n hasPrevPage,\n limit: current.limit,\n nextPage: next?.page ?? null,\n page: current.page,\n pagingCounter: (current.page - 1) * current.limit + 1,\n prevPage: prev?.page ?? null,\n totalDocs: total,\n totalPages: current.limit > 0 ? Math.ceil(total / current.limit) : 1,\n }\n}\n"],"names":["getPaginationData","contentAPIPagination","pagination","current","next","prev","total","hasNextPage","undefined","hasPrevPage","limit","nextPage","page","pagingCounter","prevPage","totalDocs","totalPages","Math","ceil"],"mappings":"AAEA,uEAAuE;AACvE,0FAA0F;AAC1F,EAAE;AACF,+BAA+B;AAC/B,IAAI;AACJ,iBAAiB;AACjB,kBAAkB;AAClB,kBAAkB;AAClB,uCAAuC;AACvC,oCAAoC;AACpC,mCAAmC;AACnC,MAAM;AACN,IAAI;AACJ,EAAE;AACF,yBAAyB;AACzB,IAAI;AACJ,iBAAiB;AACjB,uBAAuB;AACvB,uBAAuB;AACvB,eAAe;AACf,iBAAiB;AACjB,aAAa;AACb,uBAAuB;AACvB,iBAAiB;AACjB,oBAAoB;AACpB,mBAAmB;AACnB,IAAI;AACJ,OAAO,MAAMA,oBAAoB,CAC/BC,sBACAC;IAEA,MAAM,EAAEC,OAAO,EAAEC,IAAI,EAAEC,IAAI,EAAEC,KAAK,EAAE,GAAGL;IACvC,MAAMM,cAAcL,eAAe,SAASE,SAASI;IACrD,MAAMC,cAAcP,eAAe,SAASG,SAASG;IAErD,OAAO;QACLD;QACAE;QACAC,OAAOP,QAAQO,KAAK;QACpBC,UAAUP,MAAMQ,QAAQ;QACxBA,MAAMT,QAAQS,IAAI;QAClBC,eAAe,AAACV,CAAAA,QAAQS,IAAI,GAAG,CAAA,IAAKT,QAAQO,KAAK,GAAG;QACpDI,UAAUT,MAAMO,QAAQ;QACxBG,WAAWT;QACXU,YAAYb,QAAQO,KAAK,GAAG,IAAIO,KAAKC,IAAI,CAACZ,QAAQH,QAAQO,KAAK,IAAI;IACrE;AACF,EAAC"}
@@ -1,8 +0,0 @@
1
- import type { ClientConfig, SanitizedConfig } from 'payload';
2
- /**
3
- * This is the path to the admin panel WITHOUT domain.
4
- *
5
- * This respects the `basePath` property in the Next config.
6
- */
7
- export declare const getAdminPath: (config: ClientConfig | SanitizedConfig) => string;
8
- //# sourceMappingURL=getAdminPath.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getAdminPath.d.ts","sourceRoot":"","sources":["../../../src/oauth/utilities/getAdminPath.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE5D;;;;GAIG;AACH,eAAO,MAAM,YAAY,WAAY,YAAY,GAAG,eAAe,WAElE,CAAA"}
@@ -1,9 +0,0 @@
1
- /**
2
- * This is the path to the admin panel WITHOUT domain.
3
- *
4
- * This respects the `basePath` property in the Next config.
5
- */ export const getAdminPath = (config)=>{
6
- return `${process.env.NEXT_BASE_PATH ?? ''}${config.routes?.admin || '/admin'}`;
7
- };
8
-
9
- //# sourceMappingURL=getAdminPath.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../../src/oauth/utilities/getAdminPath.ts"],"sourcesContent":["import type { ClientConfig, SanitizedConfig } from 'payload'\n\n/**\n * This is the path to the admin panel WITHOUT domain.\n *\n * This respects the `basePath` property in the Next config.\n */\nexport const getAdminPath = (config: ClientConfig | SanitizedConfig) => {\n return `${process.env.NEXT_BASE_PATH ?? ''}${config.routes?.admin || '/admin'}`\n}\n"],"names":["getAdminPath","config","process","env","NEXT_BASE_PATH","routes","admin"],"mappings":"AAEA;;;;CAIC,GACD,OAAO,MAAMA,eAAe,CAACC;IAC3B,OAAO,GAAGC,QAAQC,GAAG,CAACC,cAAc,IAAI,KAAKH,OAAOI,MAAM,EAAEC,SAAS,UAAU;AACjF,EAAC"}