@payloadcms/figma 0.0.1-alpha.34 → 0.0.1-alpha.36

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 (106) hide show
  1. package/dist/auth/oauth-flow.d.ts.map +1 -1
  2. package/dist/auth/oauth-flow.js +6 -5
  3. package/dist/auth/oauth-flow.js.map +1 -1
  4. package/dist/auth/refresh.d.ts.map +1 -1
  5. package/dist/auth/refresh.js +14 -9
  6. package/dist/auth/refresh.js.map +1 -1
  7. package/dist/cli.d.ts.map +1 -1
  8. package/dist/cli.js +19 -0
  9. package/dist/cli.js.map +1 -1
  10. package/dist/commands/build-lambda-zip.d.ts +5 -0
  11. package/dist/commands/build-lambda-zip.d.ts.map +1 -0
  12. package/dist/commands/build-lambda-zip.js +19 -0
  13. package/dist/commands/build-lambda-zip.js.map +1 -0
  14. package/dist/commands/deploy.js +3 -3
  15. package/dist/commands/deploy.js.map +1 -1
  16. package/dist/commands/init.js +2 -2
  17. package/dist/commands/init.js.map +1 -1
  18. package/dist/commands/list-tokens.d.ts.map +1 -1
  19. package/dist/commands/list-tokens.js +3 -1
  20. package/dist/commands/list-tokens.js.map +1 -1
  21. package/dist/commands/login.d.ts.map +1 -1
  22. package/dist/commands/login.js +8 -5
  23. package/dist/commands/login.js.map +1 -1
  24. package/dist/config/oauth.d.ts +3 -17
  25. package/dist/config/oauth.d.ts.map +1 -1
  26. package/dist/config/oauth.js +18 -34
  27. package/dist/config/oauth.js.map +1 -1
  28. package/dist/constants.d.ts +23 -12
  29. package/dist/constants.d.ts.map +1 -1
  30. package/dist/constants.js +31 -12
  31. package/dist/constants.js.map +1 -1
  32. package/dist/db-content-api/README.md +0 -10
  33. package/dist/db-content-api/generated/content-api-types.d.ts +171 -25
  34. package/dist/db-content-api/generated/content-api-types.d.ts.map +1 -1
  35. package/dist/db-content-api/generated/content-api-types.js.map +1 -1
  36. package/dist/db-content-api/index.d.ts.map +1 -1
  37. package/dist/db-content-api/index.js +7 -8
  38. package/dist/db-content-api/index.js.map +1 -1
  39. package/dist/db-content-api/temp-utilities/sorting.d.ts +2 -6
  40. package/dist/db-content-api/temp-utilities/sorting.d.ts.map +1 -1
  41. package/dist/db-content-api/temp-utilities/sorting.js +2 -41
  42. package/dist/db-content-api/temp-utilities/sorting.js.map +1 -1
  43. package/dist/db-content-api/utilities/data/index.d.ts +2 -0
  44. package/dist/db-content-api/utilities/data/index.d.ts.map +1 -1
  45. package/dist/db-content-api/utilities/data/index.js +7 -0
  46. package/dist/db-content-api/utilities/data/index.js.map +1 -1
  47. package/dist/db-content-api/utilities/data/removeVirtualFields.d.ts +12 -0
  48. package/dist/db-content-api/utilities/data/removeVirtualFields.d.ts.map +1 -0
  49. package/dist/db-content-api/utilities/data/removeVirtualFields.js +54 -0
  50. package/dist/db-content-api/utilities/data/removeVirtualFields.js.map +1 -0
  51. package/dist/db-content-api/utilities/joins.d.ts +4 -4
  52. package/dist/db-content-api/utilities/joins.d.ts.map +1 -1
  53. package/dist/db-content-api/utilities/joins.js +12 -6
  54. package/dist/db-content-api/utilities/joins.js.map +1 -1
  55. package/dist/oauth/endpoints/getLoginEndpoint.d.ts.map +1 -1
  56. package/dist/oauth/endpoints/getLoginEndpoint.js +0 -3
  57. package/dist/oauth/endpoints/getLoginEndpoint.js.map +1 -1
  58. package/dist/oauth/index.d.ts.map +1 -1
  59. package/dist/oauth/index.js +0 -1
  60. package/dist/oauth/index.js.map +1 -1
  61. package/dist/oauth/strategy/index.d.ts +0 -2
  62. package/dist/oauth/strategy/index.d.ts.map +1 -1
  63. package/dist/oauth/strategy/index.js +33 -14
  64. package/dist/oauth/strategy/index.js.map +1 -1
  65. package/dist/plugin/build-config.d.ts.map +1 -1
  66. package/dist/plugin/build-config.js +12 -5
  67. package/dist/plugin/build-config.js.map +1 -1
  68. package/dist/types.d.ts +1 -0
  69. package/dist/types.d.ts.map +1 -1
  70. package/dist/types.js.map +1 -1
  71. package/dist/utils/asset-collection.d.ts +3 -6
  72. package/dist/utils/asset-collection.d.ts.map +1 -1
  73. package/dist/utils/asset-collection.js +10 -34
  74. package/dist/utils/asset-collection.js.map +1 -1
  75. package/dist/utils/build-lambda-zip.d.ts +14 -0
  76. package/dist/utils/build-lambda-zip.d.ts.map +1 -0
  77. package/dist/utils/build-lambda-zip.js +81 -0
  78. package/dist/utils/build-lambda-zip.js.map +1 -0
  79. package/dist/utils/config.js +1 -1
  80. package/dist/utils/config.js.map +1 -1
  81. package/dist/utils/env-management.js +2 -2
  82. package/dist/utils/env-management.js.map +1 -1
  83. package/dist/utils/formatter.d.ts.map +1 -1
  84. package/dist/utils/formatter.js +7 -3
  85. package/dist/utils/formatter.js.map +1 -1
  86. package/dist/utils/lambda-config.d.ts +3 -1
  87. package/dist/utils/lambda-config.d.ts.map +1 -1
  88. package/dist/utils/lambda-config.js +13 -22
  89. package/dist/utils/lambda-config.js.map +1 -1
  90. package/dist/utils/messages.d.ts.map +1 -1
  91. package/dist/utils/messages.js +2 -0
  92. package/dist/utils/messages.js.map +1 -1
  93. package/dist/utils/payload-config-modifier.d.ts.map +1 -1
  94. package/dist/utils/payload-config-modifier.js +7 -4
  95. package/dist/utils/payload-config-modifier.js.map +1 -1
  96. package/dist/utils/payload-package-check.d.ts +7 -1
  97. package/dist/utils/payload-package-check.d.ts.map +1 -1
  98. package/dist/utils/payload-package-check.js +29 -15
  99. package/dist/utils/payload-package-check.js.map +1 -1
  100. package/dist/utils/project.d.ts.map +1 -1
  101. package/dist/utils/project.js +4 -3
  102. package/dist/utils/project.js.map +1 -1
  103. package/dist/utils/typescript-validator.d.ts.map +1 -1
  104. package/dist/utils/typescript-validator.js +7 -4
  105. package/dist/utils/typescript-validator.js.map +1 -1
  106. package/package.json +6 -2
package/dist/types.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import type arg from 'arg';
2
2
  export interface Args extends arg.Spec {
3
3
  '--debug': BooleanConstructor;
4
+ '--env': StringConstructor;
4
5
  '--force': BooleanConstructor;
5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AM,MAAM,cAAc,GAAG,KAAK,GAAG,KAAK,GAAG,IAAI,CAAA;AAEjD,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,WAAW,GAAG,mBAAmB,CAAA"}
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type arg from 'arg'\n\nexport interface Args extends arg.Spec {\n '--debug': BooleanConstructor\n '--force': BooleanConstructor\n '--help': BooleanConstructor\n '--list': BooleanConstructor\n '--logout': BooleanConstructor\n '--yes': BooleanConstructor\n\n // Aliases\n\n '-f': string\n '-h': string\n '-y': string\n}\n\nexport type CliArgs = arg.Result<Args>\n\nexport type ProjectTemplate = GitTemplate | PluginTemplate\n\nexport type ProjectExample = {\n name: string\n url: string\n}\n\n/**\n * Template that is cloned verbatim from a git repo\n * Performs .env manipulation based upon input\n */\nexport interface GitTemplate extends Template {\n type: 'starter'\n url: string\n}\n\n/**\n * Type specifically for the plugin template\n * No .env manipulation is done\n */\nexport interface PluginTemplate extends Template {\n type: 'plugin'\n url: string\n}\n\ninterface Template {\n description?: string\n name: string\n type: ProjectTemplate['type']\n}\n\nexport type PackageManager = 'bun' | 'npm' | 'pnpm' | 'yarn'\n\nexport type DbType = 'd1-sqlite' | 'mongodb' | 'postgres' | 'sqlite' | 'vercel-postgres'\n\nexport type DbDetails = {\n dbUri?: string\n type: DbType\n}\n\nexport type EditorType = 'lexical' | 'slate'\n\nexport type NextAppDetails = {\n hasTopLevelLayout: boolean\n isPayloadInstalled?: boolean\n isSrcDir: boolean\n isSupportedNextVersion: boolean\n nextAppDir?: string\n nextConfigPath?: string\n nextConfigType?: NextConfigType\n nextVersion: null | string\n}\n\nexport type NextConfigType = 'cjs' | 'esm' | 'ts'\n\nexport type StorageAdapterType = 'localDisk' | 'r2Storage' | 'vercelBlobStorage'\n"],"names":[],"mappings":"AA0EA,WAAgF"}
1
+ {"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type arg from 'arg'\n\nexport interface Args extends arg.Spec {\n '--debug': BooleanConstructor\n '--env': StringConstructor\n '--force': BooleanConstructor\n '--help': BooleanConstructor\n '--list': BooleanConstructor\n '--logout': BooleanConstructor\n '--yes': BooleanConstructor\n\n // Aliases\n\n '-f': string\n '-h': string\n '-y': string\n}\n\nexport type CliArgs = arg.Result<Args>\n\nexport type ProjectTemplate = GitTemplate | PluginTemplate\n\nexport type ProjectExample = {\n name: string\n url: string\n}\n\n/**\n * Template that is cloned verbatim from a git repo\n * Performs .env manipulation based upon input\n */\nexport interface GitTemplate extends Template {\n type: 'starter'\n url: string\n}\n\n/**\n * Type specifically for the plugin template\n * No .env manipulation is done\n */\nexport interface PluginTemplate extends Template {\n type: 'plugin'\n url: string\n}\n\ninterface Template {\n description?: string\n name: string\n type: ProjectTemplate['type']\n}\n\nexport type PackageManager = 'bun' | 'npm' | 'pnpm' | 'yarn'\n\nexport type DbType = 'd1-sqlite' | 'mongodb' | 'postgres' | 'sqlite' | 'vercel-postgres'\n\nexport type DbDetails = {\n dbUri?: string\n type: DbType\n}\n\nexport type EditorType = 'lexical' | 'slate'\n\nexport type NextAppDetails = {\n hasTopLevelLayout: boolean\n isPayloadInstalled?: boolean\n isSrcDir: boolean\n isSupportedNextVersion: boolean\n nextAppDir?: string\n nextConfigPath?: string\n nextConfigType?: NextConfigType\n nextVersion: null | string\n}\n\nexport type NextConfigType = 'cjs' | 'esm' | 'ts'\n\nexport type StorageAdapterType = 'localDisk' | 'r2Storage' | 'vercelBlobStorage'\n"],"names":[],"mappings":"AA2EA,WAAgF"}
@@ -16,15 +16,12 @@ export declare function getFileSize(filePath: string): Promise<number>;
16
16
  */
17
17
  export declare function collectStaticAssets(projectPath: string): Promise<string[]>;
18
18
  /**
19
- * Create Lambda deployment zip using build_for_lambda.sh
19
+ * Create Lambda deployment zip
20
20
  *
21
- * This script:
22
- * - Copies static files to standalone build
23
- * - Creates lambda.zip from .next/standalone/
24
- * - Places zip at project root
21
+ * Uses cross-platform Node.js implementation instead of shell script.
25
22
  *
26
23
  * @param projectPath - Path to project root
27
- * @throws Error if script missing or execution fails
24
+ * @throws Error if build missing or zip creation fails
28
25
  */
29
26
  export declare function createLambdaZip(projectPath: string): Promise<void>;
30
27
  //# sourceMappingURL=asset-collection.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"asset-collection.d.ts","sourceRoot":"","sources":["../../src/utils/asset-collection.ts"],"names":[],"mappings":"AAYA;;;;;GAKG;AACH,wBAAsB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAGnE;AAgDD;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAchF;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAyBxE"}
1
+ {"version":3,"file":"asset-collection.d.ts","sourceRoot":"","sources":["../../src/utils/asset-collection.ts"],"names":[],"mappings":"AASA;;;;;GAKG;AACH,wBAAsB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAGnE;AAgDD;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAiBhF;AAED;;;;;;;GAOG;AACH,wBAAsB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAExE"}
@@ -1,9 +1,7 @@
1
- import { exec } from 'child_process';
2
1
  import fs from 'fs/promises';
3
2
  import path from 'path';
4
- import { promisify } from 'util';
3
+ import { buildLambdaZip } from './build-lambda-zip.js';
5
4
  import * as log from './log.js';
6
- const execAsync = promisify(exec);
7
5
  // Maximum file size for static assets (S3 limitation)
8
6
  const MAX_ASSET_SIZE = 50 * 1024 * 1024 // 50MB
9
7
  ;
@@ -75,43 +73,21 @@ const MAX_ASSET_SIZE = 50 * 1024 * 1024 // 50MB
75
73
  return [];
76
74
  }
77
75
  const files = await collectFiles(staticDir, projectPath);
78
- // Convert .next/static to _next/static (Next.js convention)
79
- return files.map((file)=>file.replace(/^\.next\//, '_next/'));
76
+ // Normalize paths to forward slashes (cross-platform) and convert prefix
77
+ return files.map((file)=>{
78
+ const normalized = file.split(path.sep).join('/');
79
+ return normalized.replace(/^\.next\//, '_next/');
80
+ });
80
81
  }
81
82
  /**
82
- * Create Lambda deployment zip using build_for_lambda.sh
83
+ * Create Lambda deployment zip
83
84
  *
84
- * This script:
85
- * - Copies static files to standalone build
86
- * - Creates lambda.zip from .next/standalone/
87
- * - Places zip at project root
85
+ * Uses cross-platform Node.js implementation instead of shell script.
88
86
  *
89
87
  * @param projectPath - Path to project root
90
- * @throws Error if script missing or execution fails
88
+ * @throws Error if build missing or zip creation fails
91
89
  */ export async function createLambdaZip(projectPath) {
92
- const scriptPath = path.join(projectPath, 'build_for_lambda.sh');
93
- // Check if script exists
94
- try {
95
- await fs.stat(scriptPath);
96
- } catch {
97
- throw new Error('build_for_lambda.sh not found. Run init command to set up project.');
98
- }
99
- // Execute script
100
- try {
101
- await execAsync('./build_for_lambda.sh', {
102
- cwd: projectPath
103
- });
104
- } catch (error) {
105
- const message = error instanceof Error ? error.message : 'Unknown error';
106
- throw new Error(`Failed to create Lambda zip: ${message}`);
107
- }
108
- // Verify zip was created
109
- const zipPath = path.join(projectPath, 'lambda.zip');
110
- try {
111
- await fs.stat(zipPath);
112
- } catch {
113
- throw new Error('lambda.zip was not created by build_for_lambda.sh');
114
- }
90
+ await buildLambdaZip(projectPath);
115
91
  }
116
92
 
117
93
  //# sourceMappingURL=asset-collection.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/asset-collection.ts"],"sourcesContent":["import { exec } from 'child_process'\nimport fs from 'fs/promises'\nimport path from 'path'\nimport { promisify } from 'util'\n\nimport * as log from './log.js'\n\nconst execAsync = promisify(exec)\n\n// Maximum file size for static assets (S3 limitation)\nconst MAX_ASSET_SIZE = 50 * 1024 * 1024 // 50MB\n\n/**\n * Get file size in bytes\n *\n * @param filePath - Absolute path to file\n * @returns File size in bytes\n */\nexport async function getFileSize(filePath: string): Promise<number> {\n const stats = await fs.stat(filePath)\n return stats.size\n}\n\n/**\n * Recursively collect files from a directory\n *\n * Excludes files larger than 50MB (S3 limitation).\n * Warns user when files are excluded due to size.\n *\n * @param dir - Directory to scan\n * @param baseDir - Base directory for relative paths\n * @returns Array of relative file paths\n */\nasync function collectFiles(dir: string, baseDir: string): Promise<string[]> {\n const files: string[] = []\n\n try {\n const entries = await fs.readdir(dir, { withFileTypes: true })\n\n for (const entry of entries) {\n const fullPath = path.join(dir, entry.name)\n\n if (entry.isDirectory()) {\n // Recursively collect from subdirectories\n const subFiles = await collectFiles(fullPath, baseDir)\n files.push(...subFiles)\n } else if (entry.isFile()) {\n // Check file size before adding\n const stats = await fs.stat(fullPath)\n if (stats.size <= MAX_ASSET_SIZE) {\n // Add relative path from base directory\n const relativePath = path.relative(baseDir, fullPath)\n files.push(relativePath)\n } else {\n // Warn user about skipped files\n const sizeMB = (stats.size / (1024 * 1024)).toFixed(2)\n const relativePath = path.relative(baseDir, fullPath)\n log.warning(`Skipping large asset: ${relativePath} (${sizeMB}MB exceeds 50MB limit)`)\n }\n }\n }\n } catch {\n // Directory doesn't exist or not accessible\n return []\n }\n\n return files\n}\n\n/**\n * Collect all static asset paths from .next/static\n *\n * Returns paths relative to project root, formatted for S3:\n * - `.next/static/chunks/main.js` → `_next/static/chunks/main.js`\n *\n * @param projectPath - Path to project root\n * @returns Array of static asset paths (using _next prefix)\n */\nexport async function collectStaticAssets(projectPath: string): Promise<string[]> {\n const staticDir = path.join(projectPath, '.next', 'static')\n\n try {\n await fs.stat(staticDir)\n } catch {\n // No static directory\n return []\n }\n\n const files = await collectFiles(staticDir, projectPath)\n\n // Convert .next/static to _next/static (Next.js convention)\n return files.map((file) => file.replace(/^\\.next\\//, '_next/'))\n}\n\n/**\n * Create Lambda deployment zip using build_for_lambda.sh\n *\n * This script:\n * - Copies static files to standalone build\n * - Creates lambda.zip from .next/standalone/\n * - Places zip at project root\n *\n * @param projectPath - Path to project root\n * @throws Error if script missing or execution fails\n */\nexport async function createLambdaZip(projectPath: string): Promise<void> {\n const scriptPath = path.join(projectPath, 'build_for_lambda.sh')\n\n // Check if script exists\n try {\n await fs.stat(scriptPath)\n } catch {\n throw new Error('build_for_lambda.sh not found. Run init command to set up project.')\n }\n\n // Execute script\n try {\n await execAsync('./build_for_lambda.sh', { cwd: projectPath })\n } catch (error) {\n const message = error instanceof Error ? error.message : 'Unknown error'\n throw new Error(`Failed to create Lambda zip: ${message}`)\n }\n\n // Verify zip was created\n const zipPath = path.join(projectPath, 'lambda.zip')\n try {\n await fs.stat(zipPath)\n } catch {\n throw new Error('lambda.zip was not created by build_for_lambda.sh')\n }\n}\n"],"names":["exec","fs","path","promisify","log","execAsync","MAX_ASSET_SIZE","getFileSize","filePath","stats","stat","size","collectFiles","dir","baseDir","files","entries","readdir","withFileTypes","entry","fullPath","join","name","isDirectory","subFiles","push","isFile","relativePath","relative","sizeMB","toFixed","warning","collectStaticAssets","projectPath","staticDir","map","file","replace","createLambdaZip","scriptPath","Error","cwd","error","message","zipPath"],"mappings":"AAAA,SAASA,IAAI,QAAQ,gBAAe;AACpC,OAAOC,QAAQ,cAAa;AAC5B,OAAOC,UAAU,OAAM;AACvB,SAASC,SAAS,QAAQ,OAAM;AAEhC,YAAYC,SAAS,WAAU;AAE/B,MAAMC,YAAYF,UAAUH;AAE5B,sDAAsD;AACtD,MAAMM,iBAAiB,KAAK,OAAO,KAAK,OAAO;;AAE/C;;;;;CAKC,GACD,OAAO,eAAeC,YAAYC,QAAgB;IAChD,MAAMC,QAAQ,MAAMR,GAAGS,IAAI,CAACF;IAC5B,OAAOC,MAAME,IAAI;AACnB;AAEA;;;;;;;;;CASC,GACD,eAAeC,aAAaC,GAAW,EAAE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GAAG,CAAC,CAACC,OAASA,KAAKC,OAAO,CAAC,aAAa;AACvD;AAEA;;;;;;;;;;CAUC,GACD,OAAO,eAAeC,gBAAgBL,WAAmB;IACvD,MAAMM,aAAarC,KAAKmB,IAAI,CAACY,aAAa;IAE1C,yBAAyB;IACzB,IAAI;QACF,MAAMhC,GAAGS,IAAI,CAAC6B;IAChB,EAAE,OAAM;QACN,MAAM,IAAIC,MAAM;IAClB;IAEA,iBAAiB;IACjB,IAAI;QACF,MAAMnC,UAAU,yBAAyB;YAAEoC,KAAKR;QAAY;IAC9D,EAAE,OAAOS,OAAO;QACd,MAAMC,UAAUD,iBAAiBF,QAAQE,MAAMC,OAAO,GAAG;QACzD,MAAM,IAAIH,MAAM,CAAC,6BAA6B,EAAEG,SAAS;IAC3D;IAEA,yBAAyB;IACzB,MAAMC,UAAU1C,KAAKmB,IAAI,CAACY,aAAa;IACvC,IAAI;QACF,MAAMhC,GAAGS,IAAI,CAACkC;IAChB,EAAE,OAAM;QACN,MAAM,IAAIJ,MAAM;IAClB;AACF"}
1
+ {"version":3,"sources":["../../src/utils/asset-collection.ts"],"sourcesContent":["import fs from 'fs/promises'\nimport path from 'path'\n\nimport { buildLambdaZip } from './build-lambda-zip.js'\nimport * as log from './log.js'\n\n// Maximum file size for static assets (S3 limitation)\nconst MAX_ASSET_SIZE = 50 * 1024 * 1024 // 50MB\n\n/**\n * Get file size in bytes\n *\n * @param filePath - Absolute path to file\n * @returns File size in bytes\n */\nexport async function getFileSize(filePath: string): Promise<number> {\n const stats = await fs.stat(filePath)\n return stats.size\n}\n\n/**\n * Recursively collect files from a directory\n *\n * Excludes files larger than 50MB (S3 limitation).\n * Warns user when files are excluded due to size.\n *\n * @param dir - Directory to scan\n * @param baseDir - Base directory for relative paths\n * @returns Array of relative file paths\n */\nasync function collectFiles(dir: string, baseDir: string): Promise<string[]> {\n const files: string[] = []\n\n try {\n const entries = await fs.readdir(dir, { withFileTypes: true })\n\n for (const entry of entries) {\n const fullPath = path.join(dir, entry.name)\n\n if (entry.isDirectory()) {\n // Recursively collect from subdirectories\n const subFiles = await collectFiles(fullPath, baseDir)\n files.push(...subFiles)\n } else if (entry.isFile()) {\n // Check file size before adding\n const stats = await fs.stat(fullPath)\n if (stats.size <= MAX_ASSET_SIZE) {\n // Add relative path from base directory\n const relativePath = path.relative(baseDir, fullPath)\n files.push(relativePath)\n } else {\n // Warn user about skipped files\n const sizeMB = (stats.size / (1024 * 1024)).toFixed(2)\n const relativePath = path.relative(baseDir, fullPath)\n log.warning(`Skipping large asset: ${relativePath} (${sizeMB}MB exceeds 50MB limit)`)\n }\n }\n }\n } catch {\n // Directory doesn't exist or not accessible\n return []\n }\n\n return files\n}\n\n/**\n * Collect all static asset paths from .next/static\n *\n * Returns paths relative to project root, formatted for S3:\n * - `.next/static/chunks/main.js` → `_next/static/chunks/main.js`\n *\n * @param projectPath - Path to project root\n * @returns Array of static asset paths (using _next prefix)\n */\nexport async function collectStaticAssets(projectPath: string): Promise<string[]> {\n const staticDir = path.join(projectPath, '.next', 'static')\n\n try {\n await fs.stat(staticDir)\n } catch {\n // No static directory\n return []\n }\n\n const files = await collectFiles(staticDir, projectPath)\n\n // Normalize paths to forward slashes (cross-platform) and convert prefix\n return files.map((file) => {\n const normalized = file.split(path.sep).join('/')\n return normalized.replace(/^\\.next\\//, '_next/')\n })\n}\n\n/**\n * Create Lambda deployment zip\n *\n * Uses cross-platform Node.js implementation instead of shell script.\n *\n * @param projectPath - Path to project root\n * @throws Error if build missing or zip creation fails\n */\nexport async function createLambdaZip(projectPath: string): Promise<void> {\n await buildLambdaZip(projectPath)\n}\n"],"names":["fs","path","buildLambdaZip","log","MAX_ASSET_SIZE","getFileSize","filePath","stats","stat","size","collectFiles","dir","baseDir","files","entries","readdir","withFileTypes","entry","fullPath","join","name","isDirectory","subFiles","push","isFile","relativePath","relative","sizeMB","toFixed","warning","collectStaticAssets","projectPath","staticDir","map","file","normalized","split","sep","replace","createLambdaZip"],"mappings":"AAAA,O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QACN,4CAA4C;QAC5C,OAAO,EAAE;IACX;IAEA,OAAOd;AACT;AAEA;;;;;;;;CAQC,GACD,OAAO,eAAeiB,oBAAoBC,WAAmB;IAC3D,MAAMC,YAAY/B,KAAKkB,IAAI,CAACY,aAAa,SAAS;IAElD,IAAI;QACF,MAAM/B,GAAGQ,IAAI,CAACwB;IAChB,EAAE,OAAM;QACN,sBAAsB;QACtB,OAAO,EAAE;IACX;IAEA,MAAMnB,QAAQ,MAAMH,aAAasB,WAAWD;IAE5C,yEAAyE;IACzE,OAAOlB,MAAMoB,GAAG,CAAC,CAACC;QAChB,MAAMC,aAAaD,KAAKE,KAAK,CAACnC,KAAKoC,GAAG,EAAElB,IAAI,CAAC;QAC7C,OAAOgB,WAAWG,OAAO,CAAC,aAAa;IACzC;AACF;AAEA;;;;;;;CAOC,GACD,OAAO,eAAeC,gBAAgBR,WAAmB;IACvD,MAAM7B,eAAe6B;AACvB"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Build Lambda deployment zip using pure Node.js
3
+ *
4
+ * Cross-platform replacement for build_for_lambda.sh:
5
+ * 1. Copies .next/static to .next/standalone/.next/static
6
+ * 2. Copies run.sh to .next/standalone/run.sh
7
+ * 3. Copies public/ to .next/standalone/public/ (if exists)
8
+ * 4. Creates lambda.zip from .next/standalone/
9
+ *
10
+ * @param projectPath - Path to project root
11
+ * @throws Error if standalone directory missing or zip creation fails
12
+ */
13
+ export declare function buildLambdaZip(projectPath: string): Promise<void>;
14
+ //# sourceMappingURL=build-lambda-zip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-lambda-zip.d.ts","sourceRoot":"","sources":["../../src/utils/build-lambda-zip.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;GAWG;AACH,wBAAsB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA+BvE"}
@@ -0,0 +1,81 @@
1
+ import archiver from 'archiver';
2
+ import { createWriteStream } from 'fs';
3
+ import fs from 'fs/promises';
4
+ import path from 'path';
5
+ /**
6
+ * Build Lambda deployment zip using pure Node.js
7
+ *
8
+ * Cross-platform replacement for build_for_lambda.sh:
9
+ * 1. Copies .next/static to .next/standalone/.next/static
10
+ * 2. Copies run.sh to .next/standalone/run.sh
11
+ * 3. Copies public/ to .next/standalone/public/ (if exists)
12
+ * 4. Creates lambda.zip from .next/standalone/
13
+ *
14
+ * @param projectPath - Path to project root
15
+ * @throws Error if standalone directory missing or zip creation fails
16
+ */ export async function buildLambdaZip(projectPath) {
17
+ const standalonePath = path.join(projectPath, '.next', 'standalone');
18
+ const staticPath = path.join(projectPath, '.next', 'static');
19
+ const publicPath = path.join(projectPath, 'public');
20
+ const runShPath = path.join(projectPath, 'run.sh');
21
+ const zipPath = path.join(projectPath, 'lambda.zip');
22
+ if (!await isDirectory(standalonePath)) {
23
+ throw new Error('Standalone build not found at .next/standalone. ' + 'Ensure next.config.js has output: "standalone" and run build first.');
24
+ }
25
+ if (await isDirectory(staticPath)) {
26
+ const destStatic = path.join(standalonePath, '.next', 'static');
27
+ await copyDirectory(staticPath, destStatic);
28
+ }
29
+ try {
30
+ await fs.copyFile(runShPath, path.join(standalonePath, 'run.sh'));
31
+ } catch {
32
+ // run.sh may not exist in all setups
33
+ }
34
+ if (await isDirectory(publicPath)) {
35
+ const destPublic = path.join(standalonePath, 'public');
36
+ await copyDirectory(publicPath, destPublic);
37
+ }
38
+ await createZip(standalonePath, zipPath);
39
+ }
40
+ async function isDirectory(dirPath) {
41
+ try {
42
+ const stats = await fs.stat(dirPath);
43
+ return stats.isDirectory();
44
+ } catch {
45
+ return false;
46
+ }
47
+ }
48
+ async function copyDirectory(src, dest) {
49
+ await fs.mkdir(dest, {
50
+ recursive: true
51
+ });
52
+ const entries = await fs.readdir(src, {
53
+ withFileTypes: true
54
+ });
55
+ for (const entry of entries){
56
+ const srcPath = path.join(src, entry.name);
57
+ const destPath = path.join(dest, entry.name);
58
+ if (entry.isDirectory()) {
59
+ await copyDirectory(srcPath, destPath);
60
+ } else {
61
+ await fs.copyFile(srcPath, destPath);
62
+ }
63
+ }
64
+ }
65
+ function createZip(sourceDir, zipPath) {
66
+ return new Promise((resolve, reject)=>{
67
+ const output = createWriteStream(zipPath);
68
+ const archive = archiver('zip', {
69
+ zlib: {
70
+ level: 9
71
+ }
72
+ });
73
+ output.on('close', ()=>resolve());
74
+ archive.on('error', (err)=>reject(err));
75
+ archive.pipe(output);
76
+ archive.directory(sourceDir, false);
77
+ void archive.finalize();
78
+ });
79
+ }
80
+
81
+ //# sourceMappingURL=build-lambda-zip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/build-lambda-zip.ts"],"sourcesContent":["import archiver from 'archiver'\nimport { createWriteStream } from 'fs'\nimport fs from 'fs/promises'\nimport path from 'path'\n\n/**\n * Build Lambda deployment zip using pure Node.js\n *\n * Cross-platform replacement for build_for_lambda.sh:\n * 1. Copies .next/static to .next/standalone/.next/static\n * 2. Copies run.sh to .next/standalone/run.sh\n * 3. Copies public/ to .next/standalone/public/ (if exists)\n * 4. Creates lambda.zip from .next/standalone/\n *\n * @param projectPath - Path to project root\n * @throws Error if standalone directory missing or zip creation fails\n */\nexport async function buildLambdaZip(projectPath: string): Promise<void> {\n const standalonePath = path.join(projectPath, '.next', 'standalone')\n const staticPath = path.join(projectPath, '.next', 'static')\n const publicPath = path.join(projectPath, 'public')\n const runShPath = path.join(projectPath, 'run.sh')\n const zipPath = path.join(projectPath, 'lambda.zip')\n\n if (!(await isDirectory(standalonePath))) {\n throw new Error(\n 'Standalone build not found at .next/standalone. ' +\n 'Ensure next.config.js has output: \"standalone\" and run build first.',\n )\n }\n\n if (await isDirectory(staticPath)) {\n const destStatic = path.join(standalonePath, '.next', 'static')\n await copyDirectory(staticPath, destStatic)\n }\n\n try {\n await fs.copyFile(runShPath, path.join(standalonePath, 'run.sh'))\n } catch {\n // run.sh may not exist in all setups\n }\n\n if (await isDirectory(publicPath)) {\n const destPublic = path.join(standalonePath, 'public')\n await copyDirectory(publicPath, destPublic)\n }\n\n await createZip(standalonePath, zipPath)\n}\n\nasync function isDirectory(dirPath: string): Promise<boolean> {\n try {\n const stats = await fs.stat(dirPath)\n return stats.isDirectory()\n } catch {\n return false\n }\n}\n\nasync function copyDirectory(src: string, dest: string): Promise<void> {\n await fs.mkdir(dest, { recursive: true })\n const entries = await fs.readdir(src, { withFileTypes: true })\n\n for (const entry of entries) {\n const srcPath = path.join(src, entry.name)\n const destPath = path.join(dest, entry.name)\n\n if (entry.isDirectory()) {\n await copyDirectory(srcPath, destPath)\n } else {\n await fs.copyFile(srcPath, destPath)\n }\n }\n}\n\nfunction createZip(sourceDir: string, zipPath: string): Promise<void> {\n return new Promise((resolve, reject) => {\n const output = createWriteStream(zipPath)\n const archive = archiver('zip', { zlib: { level: 9 } })\n\n output.on('close', () => resolve())\n archive.on('error', (err) => reject(err))\n\n archive.pipe(output)\n archive.directory(sourceDir, false)\n\n void archive.finalize()\n })\n}\n"],"names":["archiver","createWriteStream","fs","path","buildLambdaZip","projectPath","standalonePath","join","staticPath","publicPath","runShPath","zipPath","isDirectory","Error","destStatic","copyDirectory","copyFile","destPublic","createZip","dirPath","stats","stat","src","dest","mkdir","recursive","entries","readdir","withFileTypes","entry","srcPath","name","destPath","sourceDir","Promise","resolve","reject","output","archive","zlib","level","on","err","pipe","directory","finalize"],"mappings":"AAAA,OAAOA,cAAc,WAAU;AAC/B,SAASC,iBAAiB,QAAQ,KAAI;AACtC,OAAOC,QAAQ,cAAa;AAC5B,OAAOC,UAAU,OAAM;AAEvB;;;;;;;;;;;CAWC,GACD,OAAO,eAAeC,eAAeC,WAAmB;IACtD,MAAMC,iBAAiBH,KAAKI,IAAI,CAACF,aAAa,SAAS;IACvD,MAAMG,aAAaL,KAAKI,IAAI,CAACF,aAAa,SAAS;IACnD,MAAMI,aAAaN,KAAKI,IAAI,CAACF,aAAa;IAC1C,MAAMK,YAAYP,KAAKI,IAAI,CAACF,aAAa;IACzC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kBU;QACjC,MAAM2B,UAAUtC,SAAS,OAAO;YAAEuC,MAAM;gBAAEC,OAAO;YAAE;QAAE;QAErDH,OAAOI,EAAE,CAAC,SAAS,IAAMN;QACzBG,QAAQG,EAAE,CAAC,SAAS,CAACC,MAAQN,OAAOM;QAEpCJ,QAAQK,IAAI,CAACN;QACbC,QAAQM,SAAS,CAACX,WAAW;QAE7B,KAAKK,QAAQO,QAAQ;IACvB;AACF"}
@@ -19,7 +19,7 @@ const GITIGNORE_FILENAME = '.gitignore';
19
19
  }
20
20
  }
21
21
  // Parse existing entries
22
- const existingLines = existingContent.split('\n').filter((line)=>line.trim());
22
+ const existingLines = existingContent.split(/\r?\n/).filter((line)=>line.trim());
23
23
  const existingSet = new Set(existingLines);
24
24
  // Add new entries that don't exist
25
25
  const newEntries = entries.filter((entry)=>!existingSet.has(entry));
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/config.ts"],"sourcesContent":["/**\n * Configuration file management utilities\n */\n\nimport fs from 'fs/promises'\nimport path from 'path'\n\nconst GITIGNORE_FILENAME = '.gitignore'\n\n/**\n * Ensure .gitignore exists and optionally add entries\n *\n * @param projectPath - Path to project directory\n * @param entries - Optional entries to add to .gitignore\n */\nexport async function ensureGitignore(projectPath: string, entries: string[] = []): Promise<void> {\n const gitignorePath = path.join(projectPath, GITIGNORE_FILENAME)\n\n let existingContent = ''\n try {\n existingContent = await fs.readFile(gitignorePath, 'utf-8')\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== 'ENOENT') {\n throw new Error(`Failed to read ${GITIGNORE_FILENAME}: ${(error as Error).message}`)\n }\n }\n\n // Parse existing entries\n const existingLines = existingContent.split('\\n').filter((line) => line.trim())\n const existingSet = new Set(existingLines)\n\n // Add new entries that don't exist\n const newEntries = entries.filter((entry) => !existingSet.has(entry))\n\n if (newEntries.length > 0) {\n const newContent = existingContent\n ? `${existingContent.trimEnd()}\\n\\n# Figma CMS\\n${newEntries.join('\\n')}\\n`\n : `# Figma CMS\\n${newEntries.join('\\n')}\\n`\n\n await fs.writeFile(gitignorePath, newContent, 'utf-8')\n }\n}\n"],"names":["fs","path","GITIGNORE_FILENAME","ensureGitignore","projectPath","entries","gitignorePath","join","existingContent","readFile","error","code","Error","message","existingLines","split","filter","line","trim","existingSet","Set","newEntries","entry","has","length","newContent","trimEnd","writeFile"],"mappings":"AAAA;;CAEC,GAED,OAAOA,QAAQ,cAAa;AAC5B,OAAOC,UAAU,OAAM;AAEvB,MAAMC,qBAAqB;AAE3B;;;;;CAKC,GACD,OAAO,eAAeC,gBAAgBC,WAAmB,EAAEC,UAAoB,EAAE;IAC/E,MAAMC,gBAAgBL,KAAKM,IAAI,CAACH,aAAaF;IAE7C,IAAIM,kBAAkB;IACtB,IAAI;QACFA,kBAAkB,MAAMR,GAAGS,QAAQ,CAACH,eAAe;IACrD,EAAE,OAAOI,OAAO;QACd,IAAI,AAACA,MAAgCC,IAAI,KAAK,UAAU;YACtD,MAAM,IAAIC,MAAM,CAAC,eAAe,EAAEV,mBAAmB,EAAE,EAAE,AAACQ,MAAgBG,OAAO,EAAE;QACrF;IACF;IAEA,yBAAyB;IACzB,MAAMC,gBAAgBN,gBAAgBO,KAAK,CAAC,MAAMC,MAAM,CAAC,CAACC,OAASA,KAAKC,IAAI;IAC5E,MAAMC,cAAc,IAAIC,IAAIN;IAE5B,mCAAmC;IACnC,MAAMO,aAAahB,QAAQW,MAAM,CAAC,CAACM,QAAU,CAACH,YAAYI,GAAG,CAACD;IAE9D,IAAID,WAAWG,MAAM,GAAG,GAAG;QACzB,MAAMC,aAAajB,kBACf,GAAGA,gBAAgBkB,OAAO,GAAG,iBAAiB,EAAEL,WAAWd,IAAI,CAAC,MAAM,EAAE,CAAC,GACzE,CAAC,aAAa,EAAEc,WAAWd,IAAI,CAAC,MAAM,EAAE,CAAC;QAE7C,MAAMP,GAAG2B,SAAS,CAACrB,eAAemB,YAAY;IAChD;AACF"}
1
+ {"version":3,"sources":["../../src/utils/config.ts"],"sourcesContent":["/**\n * Configuration file management utilities\n */\n\nimport fs from 'fs/promises'\nimport path from 'path'\n\nconst GITIGNORE_FILENAME = '.gitignore'\n\n/**\n * Ensure .gitignore exists and optionally add entries\n *\n * @param projectPath - Path to project directory\n * @param entries - Optional entries to add to .gitignore\n */\nexport async function ensureGitignore(projectPath: string, entries: string[] = []): Promise<void> {\n const gitignorePath = path.join(projectPath, GITIGNORE_FILENAME)\n\n let existingContent = ''\n try {\n existingContent = await fs.readFile(gitignorePath, 'utf-8')\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== 'ENOENT') {\n throw new Error(`Failed to read ${GITIGNORE_FILENAME}: ${(error as Error).message}`)\n }\n }\n\n // Parse existing entries\n const existingLines = existingContent.split(/\\r?\\n/).filter((line) => line.trim())\n const existingSet = new Set(existingLines)\n\n // Add new entries that don't exist\n const newEntries = entries.filter((entry) => !existingSet.has(entry))\n\n if (newEntries.length > 0) {\n const newContent = existingContent\n ? `${existingContent.trimEnd()}\\n\\n# Figma CMS\\n${newEntries.join('\\n')}\\n`\n : `# Figma CMS\\n${newEntries.join('\\n')}\\n`\n\n await fs.writeFile(gitignorePath, newContent, 'utf-8')\n }\n}\n"],"names":["fs","path","GITIGNORE_FILENAME","ensureGitignore","projectPath","entries","gitignorePath","join","existingContent","readFile","error","code","Error","message","existingLines","split","filter","line","trim","existingSet","Set","newEntries","entry","has","length","newContent","trimEnd","writeFile"],"mappings":"AAAA;;CAEC,GAED,OAAOA,QAAQ,cAAa;AAC5B,OAAOC,UAAU,OAAM;AAEvB,MAAMC,qBAAqB;AAE3B;;;;;CAKC,GACD,OAAO,eAAeC,gBAAgBC,WAAmB,EAAEC,UAAoB,EAAE;IAC/E,MAAMC,gBAAgBL,KAAKM,IAAI,CAACH,aAAaF;IAE7C,IAAIM,kBAAkB;IACtB,IAAI;QACFA,kBAAkB,MAAMR,GAAGS,QAAQ,CAACH,eAAe;IACrD,EAAE,OAAOI,OAAO;QACd,IAAI,AAACA,MAAgCC,IAAI,KAAK,UAAU;YACtD,MAAM,IAAIC,MAAM,CAAC,eAAe,EAAEV,mBAAmB,EAAE,EAAE,AAACQ,MAAgBG,OAAO,EAAE;QACrF;IACF;IAEA,yBAAyB;IACzB,MAAMC,gBAAgBN,gBAAgBO,KAAK,CAAC,SAASC,MAAM,CAAC,CAACC,OAASA,KAAKC,IAAI;IAC/E,MAAMC,cAAc,IAAIC,IAAIN;IAE5B,mCAAmC;IACnC,MAAMO,aAAahB,QAAQW,MAAM,CAAC,CAACM,QAAU,CAACH,YAAYI,GAAG,CAACD;IAE9D,IAAID,WAAWG,MAAM,GAAG,GAAG;QACzB,MAAMC,aAAajB,kBACf,GAAGA,gBAAgBkB,OAAO,GAAG,iBAAiB,EAAEL,WAAWd,IAAI,CAAC,MAAM,EAAE,CAAC,GACzE,CAAC,aAAa,EAAEc,WAAWd,IAAI,CAAC,MAAM,EAAE,CAAC;QAE7C,MAAMP,GAAG2B,SAAS,CAACrB,eAAemB,YAAY;IAChD;AACF"}
@@ -10,7 +10,7 @@ import path from 'path';
10
10
  const envPath = path.join(projectPath, '.env');
11
11
  try {
12
12
  const contents = await fs.readFile(envPath, 'utf-8');
13
- const lines = contents.split('\n');
13
+ const lines = contents.split(/\r?\n/);
14
14
  for (const line of lines){
15
15
  // Skip empty lines and comments
16
16
  if (!line.trim() || line.trim().startsWith('#')) {
@@ -50,7 +50,7 @@ import path from 'path';
50
50
  } catch {
51
51
  // .env doesn't exist, will create it
52
52
  }
53
- const lines = contents.split('\n');
53
+ const lines = contents.split(/\r?\n/);
54
54
  const seenKeys = new Set();
55
55
  const processedLines = [];
56
56
  let keyUpdated = false;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/env-management.ts"],"sourcesContent":["import fs from 'fs/promises'\nimport path from 'path'\n\n/**\n * Get an environment variable value from .env file\n *\n * @param projectPath - Path to project directory\n * @param key - Environment variable name to retrieve\n * @returns The value if found, null otherwise\n */\nexport async function getEnvVar(projectPath: string, key: string): Promise<null | string> {\n const envPath = path.join(projectPath, '.env')\n\n try {\n const contents = await fs.readFile(envPath, 'utf-8')\n const lines = contents.split('\\n')\n\n for (const line of lines) {\n // Skip empty lines and comments\n if (!line.trim() || line.trim().startsWith('#')) {\n continue\n }\n\n // Skip lines without =\n if (!line.includes('=')) {\n continue\n }\n\n const equalsIndex = line.indexOf('=')\n const lineKey = line.substring(0, equalsIndex).trim()\n\n if (lineKey === key) {\n return line.substring(equalsIndex + 1)\n }\n }\n\n return null\n } catch {\n // File doesn't exist or can't be read\n return null\n }\n}\n\n/**\n * Add or update an environment variable in .env file\n *\n * @param projectPath - Path to project directory\n * @param key - Environment variable name\n * @param value - Environment variable value\n */\nexport async function addOrUpdateEnvVar(\n projectPath: string,\n key: string,\n value: string,\n): Promise<void> {\n const envPath = path.join(projectPath, '.env')\n\n try {\n let contents = ''\n let envExists = false\n\n // Try to read existing .env file\n try {\n contents = await fs.readFile(envPath, 'utf-8')\n envExists = true\n } catch {\n // .env doesn't exist, will create it\n }\n\n const lines = contents.split('\\n')\n const seenKeys = new Set<string>()\n const processedLines: string[] = []\n let keyUpdated = false\n\n for (const line of lines) {\n // Skip empty lines at start if file didn't exist\n if (!envExists && !line.trim()) {\n continue\n }\n\n // Preserve empty lines and comments\n if (!line.trim() || line.trim().startsWith('#')) {\n processedLines.push(line)\n continue\n }\n\n // Skip lines without =\n if (!line.includes('=')) {\n processedLines.push(line)\n continue\n }\n\n const [lineKey] = line.split('=')\n const trimmedKey = lineKey.trim()\n\n // Skip duplicate keys (keep first occurrence)\n if (seenKeys.has(trimmedKey)) {\n continue\n }\n seenKeys.add(trimmedKey)\n\n // Update or keep the line\n if (trimmedKey === key) {\n processedLines.push(`${key}=${value}`)\n keyUpdated = true\n } else {\n processedLines.push(line)\n }\n }\n\n // Add key if not present\n if (!keyUpdated) {\n processedLines.push(`${key}=${value}`)\n }\n\n await fs.writeFile(envPath, processedLines.join('\\n'), 'utf-8')\n } catch (error) {\n throw new Error(\n `Failed to update .env file: ${error instanceof Error ? error.message : 'Unknown error'}`,\n )\n }\n}\n"],"names":["fs","path","getEnvVar","projectPath","key","envPath","join","contents","readFile","lines","split","line","trim","startsWith","includes","equalsIndex","indexOf","lineKey","substring","addOrUpdateEnvVar","value","envExists","seenKeys","Set","processedLines","keyUpdated","push","trimmedKey","has","add","writeFile","error","Error","message"],"mappings":"AAAA,OAAOA,QAAQ,cAAa;AAC5B,OAAOC,UAAU,OAAM;AAEvB;;;;;;CAMC,GACD,OAAO,eAAeC,UAAUC,WAAmB,EAAEC,GAAW;IAC9D,MAAMC,UAAUJ,KAAKK,IAAI,CAACH,aAAa;IAEvC,IAAI;QACF,MAAMI,WAAW,MAAMP,GAAGQ,QAAQ,CAACH,SAAS;QAC5C,MAAMI,QAAQF,SAASG,KAAK,CAAC;QAE7B,KAAK,MAAMC,QAAQF,MAAO;YACxB,gCAAgC;YAChC,IAAI,CAACE,KAAKC,IAAI,MAAMD,KAAKC,IAAI,GAAGC,UAAU,CAAC,MAAM;gBAC/C;YACF;YAEA,uBAAuB;YACvB,IAAI,CAACF,KAAKG,QAAQ,CAAC,MAAM;gBACvB;YACF;YAEA,MAAMC,cAAcJ,KAAKK,OAAO,CAAC;YACjC,MAAMC,UAAUN,KAAKO,SAAS,CAAC,GAAGH,aAAaH,IAAI;YAEnD,IAAIK,YAAYb,KAAK;gBACnB,OAAOO,KAAKO,SAAS,CAACH,cAAc;YACtC;QACF;QAEA,OAAO;IACT,EAAE,OAAM;QACN,sCAAsC;QACtC,OAAO;IACT;AACF;AAEA;;;;;;CAMC,GACD,OAAO,eAAeI,kBACpBhB,WAAmB,EACnBC,GAAW,EACXgB,KAAa;IAEb,MAAMf,UAAUJ,KAAKK,IAAI,CAACH,aAAa;IAEvC,IAAI;QACF,IAAII,WAAW;QACf,IAAIc,YAAY;QAEhB,iCAAiC;QACjC,IAAI;YACFd,WAAW,MAAMP,GAAGQ,QAAQ,CAACH,SAAS;YACtCgB,YAAY;QACd,EAAE,OAAM;QACN,qCAAqC;QACvC;QAEA,MAAMZ,QAAQF,SAASG,KAAK,CAAC;QAC7B,MAAMY,WAAW,IAAIC;QACrB,MAAMC,iBAA2B,EAAE;QACnC,IAAIC,aAAa;QAEjB,KAAK,MAAMd,QAAQF,MAAO;YACxB,iDAAiD;YACjD,IAAI,CAACY,aAAa,CAACV,KAAKC,IAAI,IAAI;gBAC9B;YACF;YAEA,oCAAoC;YACpC,IAAI,CAACD,KAAKC,IAAI,MAAMD,KAAKC,IAAI,GAAGC,UAAU,CAAC,MAAM;gBAC/CW,eAAeE,IAAI,CAACf;gBACpB;YACF;YAEA,uBAAuB;YACvB,IAAI,CAACA,KAAKG,QAAQ,CAAC,MAAM;gBACvBU,eAAeE,IAAI,CAACf;gBACpB;YACF;YAEA,MAAM,CAACM,QAAQ,GAAGN,KAAKD,KAAK,CAAC;YAC7B,MAAMiB,aAAaV,QAAQL,IAAI;YAE/B,8CAA8C;YAC9C,IAAIU,SAASM,GAAG,CAACD,aAAa;gBAC5B;YACF;YACAL,SAASO,GAAG,CAACF;YAEb,0BAA0B;YAC1B,IAAIA,eAAevB,KAAK;gBACtBoB,eAAeE,IAAI,CAAC,GAAGtB,IAAI,CAAC,EAAEgB,OAAO;gBACrCK,aAAa;YACf,OAAO;gBACLD,eAAeE,IAAI,CAACf;YACtB;QACF;QAEA,yBAAyB;QACzB,IAAI,CAACc,YAAY;YACfD,eAAeE,IAAI,CAAC,GAAGtB,IAAI,CAAC,EAAEgB,OAAO;QACvC;QAEA,MAAMpB,GAAG8B,SAAS,CAACzB,SAASmB,eAAelB,IAAI,CAAC,OAAO;IACzD,EAAE,OAAOyB,OAAO;QACd,MAAM,IAAIC,MACR,CAAC,4BAA4B,EAAED,iBAAiBC,QAAQD,MAAME,OAAO,GAAG,iBAAiB;IAE7F;AACF"}
1
+ {"version":3,"sources":["../../src/utils/env-management.ts"],"sourcesContent":["import fs from 'fs/promises'\nimport path from 'path'\n\n/**\n * Get an environment variable value from .env file\n *\n * @param projectPath - Path to project directory\n * @param key - Environment variable name to retrieve\n * @returns The value if found, null otherwise\n */\nexport async function getEnvVar(projectPath: string, key: string): Promise<null | string> {\n const envPath = path.join(projectPath, '.env')\n\n try {\n const contents = await fs.readFile(envPath, 'utf-8')\n const lines = contents.split(/\\r?\\n/)\n\n for (const line of lines) {\n // Skip empty lines and comments\n if (!line.trim() || line.trim().startsWith('#')) {\n continue\n }\n\n // Skip lines without =\n if (!line.includes('=')) {\n continue\n }\n\n const equalsIndex = line.indexOf('=')\n const lineKey = line.substring(0, equalsIndex).trim()\n\n if (lineKey === key) {\n return line.substring(equalsIndex + 1)\n }\n }\n\n return null\n } catch {\n // File doesn't exist or can't be read\n return null\n }\n}\n\n/**\n * Add or update an environment variable in .env file\n *\n * @param projectPath - Path to project directory\n * @param key - Environment variable name\n * @param value - Environment variable value\n */\nexport async function addOrUpdateEnvVar(\n projectPath: string,\n key: string,\n value: string,\n): Promise<void> {\n const envPath = path.join(projectPath, '.env')\n\n try {\n let contents = ''\n let envExists = false\n\n // Try to read existing .env file\n try {\n contents = await fs.readFile(envPath, 'utf-8')\n envExists = true\n } catch {\n // .env doesn't exist, will create it\n }\n\n const lines = contents.split(/\\r?\\n/)\n const seenKeys = new Set<string>()\n const processedLines: string[] = []\n let keyUpdated = false\n\n for (const line of lines) {\n // Skip empty lines at start if file didn't exist\n if (!envExists && !line.trim()) {\n continue\n }\n\n // Preserve empty lines and comments\n if (!line.trim() || line.trim().startsWith('#')) {\n processedLines.push(line)\n continue\n }\n\n // Skip lines without =\n if (!line.includes('=')) {\n processedLines.push(line)\n continue\n }\n\n const [lineKey] = line.split('=')\n const trimmedKey = lineKey.trim()\n\n // Skip duplicate keys (keep first occurrence)\n if (seenKeys.has(trimmedKey)) {\n continue\n }\n seenKeys.add(trimmedKey)\n\n // Update or keep the line\n if (trimmedKey === key) {\n processedLines.push(`${key}=${value}`)\n keyUpdated = true\n } else {\n processedLines.push(line)\n }\n }\n\n // Add key if not present\n if (!keyUpdated) {\n processedLines.push(`${key}=${value}`)\n }\n\n await fs.writeFile(envPath, processedLines.join('\\n'), 'utf-8')\n } catch (error) {\n throw new Error(\n `Failed to update .env file: ${error instanceof Error ? error.message : 'Unknown error'}`,\n )\n }\n}\n"],"names":["fs","path","getEnvVar","projectPath","key","envPath","join","contents","readFile","lines","split","line","trim","startsWith","includes","equalsIndex","indexOf","lineKey","substring","addOrUpdateEnvVar","value","envExists","seenKeys","Set","processedLines","keyUpdated","push","trimmedKey","has","add","writeFile","error","Error","message"],"mappings":"AAAA,OAAOA,QAAQ,cAAa;AAC5B,OAAOC,UAAU,OAAM;AAEvB;;;;;;CAMC,GACD,OAAO,eAAeC,UAAUC,WAAmB,EAAEC,GAAW;IAC9D,MAAMC,UAAUJ,KAAKK,IAAI,CAACH,aAAa;IAEvC,IAAI;QACF,MAAMI,WAAW,MAAMP,GAAGQ,QAAQ,CAACH,SAAS;QAC5C,MAAMI,QAAQF,SAASG,KAAK,CAAC;QAE7B,KAAK,MAAMC,QAAQF,MAAO;YACxB,gCAAgC;YAChC,IAAI,CAACE,KAAKC,IAAI,MAAMD,KAAKC,IAAI,GAAGC,UAAU,CAAC,MAAM;gBAC/C;YACF;YAEA,uBAAuB;YACvB,IAAI,CAACF,KAAKG,QAAQ,CAAC,MAAM;gBACvB;YACF;YAEA,MAAMC,cAAcJ,KAAKK,OAAO,CAAC;YACjC,MAAMC,UAAUN,KAAKO,SAAS,CAAC,GAAGH,aAAaH,IAAI;YAEnD,IAAIK,YAAYb,KAAK;gBACnB,OAAOO,KAAKO,SAAS,CAACH,cAAc;YACtC;QACF;QAEA,OAAO;IACT,EAAE,OAAM;QACN,sCAAsC;QACtC,OAAO;IACT;AACF;AAEA;;;;;;CAMC,GACD,OAAO,eAAeI,kBACpBhB,WAAmB,EACnBC,GAAW,EACXgB,KAAa;IAEb,MAAMf,UAAUJ,KAAKK,IAAI,CAACH,aAAa;IAEvC,IAAI;QACF,IAAII,WAAW;QACf,IAAIc,YAAY;QAEhB,i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@@
1
- {"version":3,"file":"formatter.d.ts","sourceRoot":"","sources":["../../src/utils/formatter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1D,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED;;;GAGG;AACH,wBAAsB,UAAU,CAC9B,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,cAAc,GAC7B,OAAO,CAAC,YAAY,CAAC,CAiCvB"}
1
+ {"version":3,"file":"formatter.d.ts","sourceRoot":"","sources":["../../src/utils/formatter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1D,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED;;;GAGG;AACH,wBAAsB,UAAU,CAC9B,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,cAAc,GAC7B,OAAO,CAAC,YAAY,CAAC,CAgCvB"}
@@ -1,4 +1,4 @@
1
- import { spawn } from 'child_process';
1
+ import spawn from 'cross-spawn';
2
2
  import path from 'path';
3
3
  /**
4
4
  * Format file with Prettier
@@ -6,9 +6,13 @@ import path from 'path';
6
6
  */ export async function formatFile(filePath, packageManager) {
7
7
  return new Promise((resolve)=>{
8
8
  try {
9
- const child = spawn(`${packageManager} exec prettier --write "${filePath}"`, {
9
+ const child = spawn(packageManager, [
10
+ 'exec',
11
+ 'prettier',
12
+ '--write',
13
+ filePath
14
+ ], {
10
15
  cwd: path.dirname(filePath),
11
- shell: true,
12
16
  stdio: 'pipe'
13
17
  });
14
18
  child.on('close', (code)=>{
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/formatter.ts"],"sourcesContent":["import { spawn } from 'child_process'\nimport path from 'path'\n\nimport type { PackageManager } from './package-manager.js'\n\nexport type FormatResult = {\n success: boolean\n warning?: string\n}\n\n/**\n * Format file with Prettier\n * Returns warning if formatting fails but does not throw\n */\nexport async function formatFile(\n filePath: string,\n packageManager: PackageManager,\n): Promise<FormatResult> {\n return new Promise((resolve) => {\n try {\n const child = spawn(`${packageManager} exec prettier --write \"${filePath}\"`, {\n cwd: path.dirname(filePath),\n shell: true,\n stdio: 'pipe',\n })\n\n child.on('close', (code) => {\n if (code === 0) {\n resolve({ success: true })\n } else {\n resolve({\n success: false,\n warning: 'Could not format file with Prettier',\n })\n }\n })\n\n child.on('error', () => {\n resolve({\n success: false,\n warning: 'Could not format file with Prettier',\n })\n })\n } catch {\n resolve({\n success: false,\n warning: 'Could not format file with Prettier',\n })\n }\n })\n}\n"],"names":["spawn","path","formatFile","filePath","packageManager","Promise","resolve","child","cwd","dirname","shell","stdio","on","code","success","warning"],"mappings":"AAAA,SAASA,KAAK,QAAQ,gBAAe;AACrC,OAAOC,UAAU,OAAM;AASvB;;;CAGC,GACD,OAAO,eAAeC,WACpBC,QAAgB,EAChBC,cAA8B;IAE9B,OAAO,IAAIC,QAAQ,CAACC;QAClB,IAAI;YACF,MAAMC,QAAQP,MAAM,GAAGI,eAAe,wBAAwB,EAAED,SAAS,CAAC,CAAC,EAAE;gBAC3EK,KAAKP,KAAKQ,OAAO,CAACN;gBAClBO,OAAO;gBACPC,OAAO;YACT;YAEAJ,MAAMK,EAAE,CAAC,SAAS,CAACC;gBACjB,IAAIA,SAAS,GAAG;oBACdP,QAAQ;wBAAEQ,SAAS;oBAAK;gBAC1B,OAAO;oBACLR,QAAQ;wBACNQ,SAAS;wBACTC,SAAS;oBACX;gBACF;YACF;YAEAR,MAAMK,EAAE,CAAC,SAAS;gBAChBN,QAAQ;oBACNQ,SAAS;oBACTC,SAAS;gBACX;YACF;QACF,EAAE,OAAM;YACNT,QAAQ;gBACNQ,SAAS;gBACTC,SAAS;YACX;QACF;IACF;AACF"}
1
+ {"version":3,"sources":["../../src/utils/formatter.ts"],"sourcesContent":["import spawn from 'cross-spawn'\nimport path from 'path'\n\nimport type { PackageManager } from './package-manager.js'\n\nexport type FormatResult = {\n success: boolean\n warning?: string\n}\n\n/**\n * Format file with Prettier\n * Returns warning if formatting fails but does not throw\n */\nexport async function formatFile(\n filePath: string,\n packageManager: PackageManager,\n): Promise<FormatResult> {\n return new Promise((resolve) => {\n try {\n const child = spawn(packageManager, ['exec', 'prettier', '--write', filePath], {\n cwd: path.dirname(filePath),\n stdio: 'pipe',\n })\n\n child.on('close', (code) => {\n if (code === 0) {\n resolve({ success: true })\n } else {\n resolve({\n success: false,\n warning: 'Could not format file with Prettier',\n })\n }\n })\n\n child.on('error', () => {\n resolve({\n success: false,\n warning: 'Could not format file with Prettier',\n })\n })\n } catch {\n resolve({\n success: false,\n warning: 'Could not format file with Prettier',\n })\n }\n })\n}\n"],"names":["spawn","path","formatFile","filePath","packageManager","Promise","resolve","child","cwd","dirname","stdio","on","code","success","warning"],"mappings":"AAAA,OAAOA,WAAW,cAAa;AAC/B,OAAOC,UAAU,OAAM;AASvB;;;CAGC,GACD,OAAO,eAAeC,WACpBC,QAAgB,EAChBC,cAA8B;IAE9B,OAAO,IAAIC,QAAQ,CAACC;QAClB,IAAI;YACF,MAAMC,QAAQP,MAAMI,gBAAgB;gBAAC;gBAAQ;gBAAY;gBAAWD;aAAS,EAAE;gBAC7EK,KAAKP,KAAKQ,OAAO,CAACN;gBAClBO,OAAO;YACT;YAEAH,MAAMI,EAAE,CAAC,SAAS,CAACC;gBACjB,IAAIA,SAAS,GAAG;oBACdN,QAAQ;wBAAEO,SAAS;oBAAK;gBAC1B,OAAO;oBACLP,QAAQ;wBACNO,SAAS;wBACTC,SAAS;oBACX;gBACF;YACF;YAEAP,MAAMI,EAAE,CAAC,SAAS;gBAChBL,QAAQ;oBACNO,SAAS;oBACTC,SAAS;gBACX;YACF;QACF,EAAE,OAAM;YACNR,QAAQ;gBACNO,SAAS;gBACTC,SAAS;YACX;QACF;IACF;AACF"}
@@ -1,7 +1,9 @@
1
+ import type { PackageManager } from './package-manager.js';
1
2
  /**
2
3
  * Apply Lambda-specific modifications to a Payload project
3
4
  *
4
5
  * @param projectPath - Path to project directory
6
+ * @param packageManager - Package manager to use in scripts (defaults to 'pnpm')
5
7
  */
6
- export declare function applyLambdaModifications(projectPath: string): Promise<void>;
8
+ export declare function applyLambdaModifications(projectPath: string, packageManager?: PackageManager): Promise<void>;
7
9
  //# sourceMappingURL=lambda-config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lambda-config.d.ts","sourceRoot":"","sources":["../../src/utils/lambda-config.ts"],"names":[],"mappings":"AAqBA;;;;GAIG;AACH,wBAAsB,wBAAwB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAgCjF"}
1
+ {"version":3,"file":"lambda-config.d.ts","sourceRoot":"","sources":["../../src/utils/lambda-config.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAS1D;;;;;GAKG;AACH,wBAAsB,wBAAwB,CAC5C,WAAW,EAAE,MAAM,EACnB,cAAc,GAAE,cAAuB,GACtC,OAAO,CAAC,IAAI,CAAC,CA2Bf"}
@@ -7,31 +7,19 @@ const RUN_SH_CONTENT = `#!/bin/bash -x
7
7
 
8
8
  NODE_ENV=production exec node server.js
9
9
  `;
10
- const BUILD_FOR_LAMBDA_SH_CONTENT = `#!/bin/bash
11
-
12
- cp -r .next/static .next/standalone/.next/static
13
- cp run.sh .next/standalone/run.sh
14
- [ -d public ] && cp -r public .next/standalone/public
15
- cd .next/standalone
16
- zip -r --symlinks lambda.zip .
17
- mv lambda.zip ../..
18
- `;
19
10
  /**
20
11
  * Apply Lambda-specific modifications to a Payload project
21
12
  *
22
13
  * @param projectPath - Path to project directory
23
- */ export async function applyLambdaModifications(projectPath) {
14
+ * @param packageManager - Package manager to use in scripts (defaults to 'pnpm')
15
+ */ export async function applyLambdaModifications(projectPath, packageManager = 'pnpm') {
24
16
  // 1. Create run.sh
25
17
  const runShPath = path.join(projectPath, 'run.sh');
26
18
  await fs.writeFile(runShPath, RUN_SH_CONTENT, 'utf-8');
27
- await fs.chmod(runShPath, 0o755); // rwxr-xr-x
28
- // 2. Create build_for_lambda.sh
29
- const buildShPath = path.join(projectPath, 'build_for_lambda.sh');
30
- await fs.writeFile(buildShPath, BUILD_FOR_LAMBDA_SH_CONTENT, 'utf-8');
31
- await fs.chmod(buildShPath, 0o755);
32
- // 3. Modify next config to add standalone output
19
+ await fs.chmod(runShPath, 0o755);
20
+ // 2. Modify next config to add standalone output
33
21
  await addStandaloneToNextConfig(projectPath);
34
- // 4. Create/update .npmrc
22
+ // 3. Create/update .npmrc
35
23
  const npmrcPath = path.join(projectPath, '.npmrc');
36
24
  let npmrcContent = '';
37
25
  try {
@@ -44,8 +32,8 @@ mv lambda.zip ../..
44
32
  npmrcContent += 'node-linker=hoisted\n';
45
33
  await fs.writeFile(npmrcPath, npmrcContent, 'utf-8');
46
34
  }
47
- // 5. Add lambda:buildzip script to package.json
48
- await addLambdaBuildScript(projectPath);
35
+ // 4. Add lambda:buildzip script to package.json
36
+ await addLambdaBuildScript(projectPath, packageManager);
49
37
  }
50
38
  /**
51
39
  * Find the Next.js config file (next.config.js or next.config.mjs)
@@ -115,7 +103,7 @@ mv lambda.zip ../..
115
103
  throw new Error(`Could not find Next.js config object in ${path.basename(nextConfigPath)}. ` + `Expected either 'export default { ... }' or 'export default wrapper(configVar, ...)'`);
116
104
  }
117
105
  const { loc } = targetObjectExpression;
118
- const lines = content.split('\n');
106
+ const lines = content.split(/\r?\n/);
119
107
  // Insert output: 'standalone' as first property
120
108
  const insertLine = loc.start.line - 1;
121
109
  const insertColumn = loc.start.column + 1 // After opening brace
@@ -131,14 +119,17 @@ mv lambda.zip ../..
131
119
  }
132
120
  /**
133
121
  * Add lambda:buildzip script to package.json
134
- */ async function addLambdaBuildScript(projectPath) {
122
+ */ async function addLambdaBuildScript(projectPath, packageManager) {
135
123
  const packageJsonPath = path.join(projectPath, 'package.json');
136
124
  const content = await fs.readFile(packageJsonPath, 'utf-8');
137
125
  const packageJson = JSON.parse(content);
138
126
  if (!packageJson.scripts) {
139
127
  packageJson.scripts = {};
140
128
  }
141
- packageJson.scripts['lambda:buildzip'] = 'npm run build && ./build_for_lambda.sh';
129
+ // Use package manager's run and exec commands
130
+ const runCmd = packageManager === 'npm' ? 'npm run' : packageManager;
131
+ const execCmd = packageManager === 'npm' ? 'npx' : `${packageManager} exec`;
132
+ packageJson.scripts['lambda:buildzip'] = `${runCmd} build && ${execCmd} payloadcms-figma build-lambda-zip`;
142
133
  await fs.writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2) + '\n', 'utf-8');
143
134
  }
144
135
 
@@ -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\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\nconst BUILD_FOR_LAMBDA_SH_CONTENT = `#!/bin/bash\n\ncp -r .next/static .next/standalone/.next/static\ncp run.sh .next/standalone/run.sh\n[ -d public ] && cp -r public .next/standalone/public\ncd .next/standalone\nzip -r --symlinks lambda.zip .\nmv lambda.zip ../..\n`\n\n/**\n * Apply Lambda-specific modifications to a Payload project\n *\n * @param projectPath - Path to project directory\n */\nexport async function applyLambdaModifications(projectPath: string): 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) // rwxr-xr-x\n\n // 2. Create build_for_lambda.sh\n const buildShPath = path.join(projectPath, 'build_for_lambda.sh')\n await fs.writeFile(buildShPath, BUILD_FOR_LAMBDA_SH_CONTENT, 'utf-8')\n await fs.chmod(buildShPath, 0o755)\n\n // 3. Modify next config to add standalone output\n await addStandaloneToNextConfig(projectPath)\n\n // 4. 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 // 5. Add lambda:buildzip script to package.json\n await addLambdaBuildScript(projectPath)\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('\\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(projectPath: string): 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 packageJson.scripts['lambda:buildzip'] = 'npm run build && ./build_for_lambda.sh'\n\n await fs.writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2) + '\\n', 'utf-8')\n}\n"],"names":["parseModule","Syntax","fs","path","RUN_SH_CONTENT","BUILD_FOR_LAMBDA_SH_CONTENT","applyLambdaModifications","projectPath","runShPath","join","writeFile","chmod","buildShPath","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","stringify"],"mappings":"AAAA,SAASA,WAAW,EAAEC,MAAM,QAAQ,eAAc;AAClD,OAAOC,QAAQ,cAAa;AAC5B,OAAOC,UAAU,OAAM;AAEvB,MAAMC,iBAAiB,CAAC;;;;;AAKxB,CAAC;AAED,MAAMC,8BAA8B,CAAC;;;;;;;;AAQrC,CAAC;A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GQ,SAAS,CAACsD,iBAAiBE,KAAKG,SAAS,CAACJ,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\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,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,CAACF,WAAWJ,gBAAgB;IAC9C,MAAMF,GAAGS,KAAK,CAACH,WAAW;IAE1B,iDAAiD;IACjD,MAAMI,0BAA0BN;IAEhC,0BAA0B;IAC1B,MAAMO,YAAYV,KAAKM,IAAI,CAACH,aAAa;IACzC,IAAIQ,eAAe;IAEnB,IAAI;QACFA,eAAe,MAAMZ,GAAGa,QAAQ,CAACF,WAAW;IAC9C,EAAE,OAAM;IACN,kCAAkC;IACpC;IAEA,IAAI,CAACC,aAAaE,QAAQ,CAAC,wBAAwB;QACjDF,gBAAgBA,gBAAgB,CAACA,aAAaG,QAAQ,CAAC,QAAQ,OAAO;QACtEH,gBAAgB;QAChB,MAAMZ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BAAgB,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"}
@@ -15,11 +15,13 @@ export function helpMessage() {
15
15
  ${pc.cyan('list-tokens')} Show stored token information
16
16
  ${pc.cyan('init')} Initialize a Figma CMS project
17
17
  ${pc.cyan('deploy')} Deploy your project to Figma
18
+ ${pc.cyan('build-lambda-zip')} Build Lambda deployment zip
18
19
 
19
20
  ${pc.bold('OPTIONS')}
20
21
 
21
22
  ${pc.dim('-h, --help Show help')}
22
23
  ${pc.dim('--debug Enable debug logging')}
24
+ ${pc.dim('--env <env> Set environment: prod or staging (default: staging)')}
23
25
 
24
26
  ${pc.bold('AUTHENTICATION')}
25
27