@payloadcms/figma 0.0.1-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +11 -0
- package/bin/cli.js +4 -0
- package/dist/api/control-plane.d.ts +124 -0
- package/dist/api/control-plane.d.ts.map +1 -0
- package/dist/api/control-plane.js +245 -0
- package/dist/api/control-plane.js.map +1 -0
- package/dist/api/control-plane.spec.d.ts +2 -0
- package/dist/api/control-plane.spec.d.ts.map +1 -0
- package/dist/api/control-plane.spec.js +296 -0
- package/dist/api/control-plane.spec.js.map +1 -0
- package/dist/api/figma-api.d.ts +31 -0
- package/dist/api/figma-api.d.ts.map +1 -0
- package/dist/api/figma-api.js +169 -0
- package/dist/api/figma-api.js.map +1 -0
- package/dist/api/figma-api.spec.d.ts +14 -0
- package/dist/api/figma-api.spec.d.ts.map +1 -0
- package/dist/api/figma-api.spec.js +201 -0
- package/dist/api/figma-api.spec.js.map +1 -0
- package/dist/auth/__tests__/fixtures.d.ts +26 -0
- package/dist/auth/__tests__/fixtures.d.ts.map +1 -0
- package/dist/auth/__tests__/fixtures.js +67 -0
- package/dist/auth/__tests__/fixtures.js.map +1 -0
- package/dist/auth/__tests__/mocks.d.ts +33 -0
- package/dist/auth/__tests__/mocks.d.ts.map +1 -0
- package/dist/auth/__tests__/mocks.js +63 -0
- package/dist/auth/__tests__/mocks.js.map +1 -0
- package/dist/auth/browser.d.ts +31 -0
- package/dist/auth/browser.d.ts.map +1 -0
- package/dist/auth/browser.js +41 -0
- package/dist/auth/browser.js.map +1 -0
- package/dist/auth/callback-server.d.ts +61 -0
- package/dist/auth/callback-server.d.ts.map +1 -0
- package/dist/auth/callback-server.js +168 -0
- package/dist/auth/callback-server.js.map +1 -0
- package/dist/auth/callback-server.spec.d.ts +2 -0
- package/dist/auth/callback-server.spec.d.ts.map +1 -0
- package/dist/auth/callback-server.spec.js +85 -0
- package/dist/auth/callback-server.spec.js.map +1 -0
- package/dist/auth/crypto-utils.d.ts +33 -0
- package/dist/auth/crypto-utils.d.ts.map +1 -0
- package/dist/auth/crypto-utils.js +96 -0
- package/dist/auth/crypto-utils.js.map +1 -0
- package/dist/auth/crypto-utils.spec.d.ts +2 -0
- package/dist/auth/crypto-utils.spec.d.ts.map +1 -0
- package/dist/auth/crypto-utils.spec.js +36 -0
- package/dist/auth/crypto-utils.spec.js.map +1 -0
- package/dist/auth/jwt-validator.d.ts +41 -0
- package/dist/auth/jwt-validator.d.ts.map +1 -0
- package/dist/auth/jwt-validator.js +113 -0
- package/dist/auth/jwt-validator.js.map +1 -0
- package/dist/auth/jwt-validator.spec.d.ts +10 -0
- package/dist/auth/jwt-validator.spec.d.ts.map +1 -0
- package/dist/auth/jwt-validator.spec.js +236 -0
- package/dist/auth/jwt-validator.spec.js.map +1 -0
- package/dist/auth/oauth-flow.d.ts +62 -0
- package/dist/auth/oauth-flow.d.ts.map +1 -0
- package/dist/auth/oauth-flow.js +172 -0
- package/dist/auth/oauth-flow.js.map +1 -0
- package/dist/auth/oauth-flow.spec.d.ts +2 -0
- package/dist/auth/oauth-flow.spec.d.ts.map +1 -0
- package/dist/auth/oauth-flow.spec.js +134 -0
- package/dist/auth/oauth-flow.spec.js.map +1 -0
- package/dist/auth/pages/error.html +85 -0
- package/dist/auth/pages/success.html +74 -0
- package/dist/auth/pkce.d.ts +51 -0
- package/dist/auth/pkce.d.ts.map +1 -0
- package/dist/auth/pkce.js +71 -0
- package/dist/auth/pkce.js.map +1 -0
- package/dist/auth/pkce.spec.d.ts +2 -0
- package/dist/auth/pkce.spec.d.ts.map +1 -0
- package/dist/auth/pkce.spec.js +32 -0
- package/dist/auth/pkce.spec.js.map +1 -0
- package/dist/auth/project-token.d.ts +47 -0
- package/dist/auth/project-token.d.ts.map +1 -0
- package/dist/auth/project-token.js +134 -0
- package/dist/auth/project-token.js.map +1 -0
- package/dist/auth/project-token.spec.d.ts +2 -0
- package/dist/auth/project-token.spec.d.ts.map +1 -0
- package/dist/auth/project-token.spec.js +332 -0
- package/dist/auth/project-token.spec.js.map +1 -0
- package/dist/auth/refresh.d.ts +35 -0
- package/dist/auth/refresh.d.ts.map +1 -0
- package/dist/auth/refresh.js +149 -0
- package/dist/auth/refresh.js.map +1 -0
- package/dist/auth/refresh.spec.d.ts +2 -0
- package/dist/auth/refresh.spec.d.ts.map +1 -0
- package/dist/auth/refresh.spec.js +105 -0
- package/dist/auth/refresh.spec.js.map +1 -0
- package/dist/auth/token-store.d.ts +110 -0
- package/dist/auth/token-store.d.ts.map +1 -0
- package/dist/auth/token-store.js +188 -0
- package/dist/auth/token-store.js.map +1 -0
- package/dist/auth/token-store.spec.d.ts +2 -0
- package/dist/auth/token-store.spec.d.ts.map +1 -0
- package/dist/auth/token-store.spec.js +276 -0
- package/dist/auth/token-store.spec.js.map +1 -0
- package/dist/auth/types.d.ts +197 -0
- package/dist/auth/types.d.ts.map +1 -0
- package/dist/auth/types.js +6 -0
- package/dist/auth/types.js.map +1 -0
- package/dist/cli.d.ts +5 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +108 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/__tests__/test-utils.d.ts +28 -0
- package/dist/commands/__tests__/test-utils.d.ts.map +1 -0
- package/dist/commands/__tests__/test-utils.js +34 -0
- package/dist/commands/__tests__/test-utils.js.map +1 -0
- package/dist/commands/deploy.d.ts +16 -0
- package/dist/commands/deploy.d.ts.map +1 -0
- package/dist/commands/deploy.js +297 -0
- package/dist/commands/deploy.js.map +1 -0
- package/dist/commands/deploy.spec.d.ts +2 -0
- package/dist/commands/deploy.spec.d.ts.map +1 -0
- package/dist/commands/deploy.spec.js +18 -0
- package/dist/commands/deploy.spec.js.map +1 -0
- package/dist/commands/init.d.ts +30 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +410 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/init.spec.d.ts +2 -0
- package/dist/commands/init.spec.d.ts.map +1 -0
- package/dist/commands/init.spec.js +283 -0
- package/dist/commands/init.spec.js.map +1 -0
- package/dist/commands/list-tokens.d.ts +16 -0
- package/dist/commands/list-tokens.d.ts.map +1 -0
- package/dist/commands/list-tokens.js +44 -0
- package/dist/commands/list-tokens.js.map +1 -0
- package/dist/commands/login.d.ts +17 -0
- package/dist/commands/login.d.ts.map +1 -0
- package/dist/commands/login.js +69 -0
- package/dist/commands/login.js.map +1 -0
- package/dist/commands/logout.d.ts +16 -0
- package/dist/commands/logout.d.ts.map +1 -0
- package/dist/commands/logout.js +43 -0
- package/dist/commands/logout.js.map +1 -0
- package/dist/config/oauth.d.ts +19 -0
- package/dist/config/oauth.d.ts.map +1 -0
- package/dist/config/oauth.js +43 -0
- package/dist/config/oauth.js.map +1 -0
- package/dist/constants.d.ts +27 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +27 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin/adapter.d.ts +5 -0
- package/dist/plugin/adapter.d.ts.map +1 -0
- package/dist/plugin/adapter.js +139 -0
- package/dist/plugin/adapter.js.map +1 -0
- package/dist/plugin/build-config.d.ts +37 -0
- package/dist/plugin/build-config.d.ts.map +1 -0
- package/dist/plugin/build-config.js +25 -0
- package/dist/plugin/build-config.js.map +1 -0
- package/dist/plugin/build-config.spec.d.ts +2 -0
- package/dist/plugin/build-config.spec.d.ts.map +1 -0
- package/dist/plugin/build-config.spec.js +72 -0
- package/dist/plugin/build-config.spec.js.map +1 -0
- package/dist/types/config.d.ts +45 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +9 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types.d.ts +60 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/asset-collection.d.ts +30 -0
- package/dist/utils/asset-collection.d.ts.map +1 -0
- package/dist/utils/asset-collection.js +117 -0
- package/dist/utils/asset-collection.js.map +1 -0
- package/dist/utils/asset-collection.spec.d.ts +2 -0
- package/dist/utils/asset-collection.spec.d.ts.map +1 -0
- package/dist/utils/asset-collection.spec.js +155 -0
- package/dist/utils/asset-collection.spec.js.map +1 -0
- package/dist/utils/build-detection.d.ts +32 -0
- package/dist/utils/build-detection.d.ts.map +1 -0
- package/dist/utils/build-detection.js +55 -0
- package/dist/utils/build-detection.js.map +1 -0
- package/dist/utils/build-detection.spec.d.ts +2 -0
- package/dist/utils/build-detection.spec.d.ts.map +1 -0
- package/dist/utils/build-detection.spec.js +110 -0
- package/dist/utils/build-detection.spec.js.map +1 -0
- package/dist/utils/config.d.ts +33 -0
- package/dist/utils/config.d.ts.map +1 -0
- package/dist/utils/config.js +78 -0
- package/dist/utils/config.js.map +1 -0
- package/dist/utils/config.spec.d.ts +2 -0
- package/dist/utils/config.spec.d.ts.map +1 -0
- package/dist/utils/config.spec.js +167 -0
- package/dist/utils/config.spec.js.map +1 -0
- package/dist/utils/download-template.d.ts +15 -0
- package/dist/utils/download-template.d.ts.map +1 -0
- package/dist/utils/download-template.js +74 -0
- package/dist/utils/download-template.js.map +1 -0
- package/dist/utils/download-template.spec.d.ts +2 -0
- package/dist/utils/download-template.spec.d.ts.map +1 -0
- package/dist/utils/download-template.spec.js +76 -0
- package/dist/utils/download-template.spec.js.map +1 -0
- package/dist/utils/env-management.d.ts +16 -0
- package/dist/utils/env-management.d.ts.map +1 -0
- package/dist/utils/env-management.js +98 -0
- package/dist/utils/env-management.js.map +1 -0
- package/dist/utils/env-management.spec.d.ts +2 -0
- package/dist/utils/env-management.spec.d.ts.map +1 -0
- package/dist/utils/env-management.spec.js +123 -0
- package/dist/utils/env-management.spec.js.map +1 -0
- package/dist/utils/format.d.ts +23 -0
- package/dist/utils/format.d.ts.map +1 -0
- package/dist/utils/format.js +49 -0
- package/dist/utils/format.js.map +1 -0
- package/dist/utils/formatter.d.ts +11 -0
- package/dist/utils/formatter.d.ts.map +1 -0
- package/dist/utils/formatter.js +47 -0
- package/dist/utils/formatter.js.map +1 -0
- package/dist/utils/git.d.ts +15 -0
- package/dist/utils/git.d.ts.map +1 -0
- package/dist/utils/git.js +92 -0
- package/dist/utils/git.js.map +1 -0
- package/dist/utils/git.spec.d.ts +2 -0
- package/dist/utils/git.spec.d.ts.map +1 -0
- package/dist/utils/git.spec.js +99 -0
- package/dist/utils/git.spec.js.map +1 -0
- package/dist/utils/is-debug.d.ts +6 -0
- package/dist/utils/is-debug.d.ts.map +1 -0
- package/dist/utils/is-debug.js +8 -0
- package/dist/utils/is-debug.js.map +1 -0
- package/dist/utils/lambda-config.d.ts +7 -0
- package/dist/utils/lambda-config.d.ts.map +1 -0
- package/dist/utils/lambda-config.js +144 -0
- package/dist/utils/lambda-config.js.map +1 -0
- package/dist/utils/lambda-config.spec.d.ts +2 -0
- package/dist/utils/lambda-config.spec.d.ts.map +1 -0
- package/dist/utils/lambda-config.spec.js +141 -0
- package/dist/utils/lambda-config.spec.js.map +1 -0
- package/dist/utils/log.d.ts +6 -0
- package/dist/utils/log.d.ts.map +1 -0
- package/dist/utils/log.js +22 -0
- package/dist/utils/log.js.map +1 -0
- package/dist/utils/messages.d.ts +10 -0
- package/dist/utils/messages.d.ts.map +1 -0
- package/dist/utils/messages.js +96 -0
- package/dist/utils/messages.js.map +1 -0
- package/dist/utils/package-manager.d.ts +12 -0
- package/dist/utils/package-manager.d.ts.map +1 -0
- package/dist/utils/package-manager.js +37 -0
- package/dist/utils/package-manager.js.map +1 -0
- package/dist/utils/payload-config-ast.d.ts +30 -0
- package/dist/utils/payload-config-ast.d.ts.map +1 -0
- package/dist/utils/payload-config-ast.js +259 -0
- package/dist/utils/payload-config-ast.js.map +1 -0
- package/dist/utils/payload-config-ast.spec.d.ts +2 -0
- package/dist/utils/payload-config-ast.spec.d.ts.map +1 -0
- package/dist/utils/payload-config-ast.spec.js +303 -0
- package/dist/utils/payload-config-ast.spec.js.map +1 -0
- package/dist/utils/payload-config-finder.d.ts +9 -0
- package/dist/utils/payload-config-finder.d.ts.map +1 -0
- package/dist/utils/payload-config-finder.js +26 -0
- package/dist/utils/payload-config-finder.js.map +1 -0
- package/dist/utils/payload-config-modifier.d.ts +18 -0
- package/dist/utils/payload-config-modifier.d.ts.map +1 -0
- package/dist/utils/payload-config-modifier.int.spec.d.ts +2 -0
- package/dist/utils/payload-config-modifier.int.spec.d.ts.map +1 -0
- package/dist/utils/payload-config-modifier.int.spec.js +116 -0
- package/dist/utils/payload-config-modifier.int.spec.js.map +1 -0
- package/dist/utils/payload-config-modifier.js +232 -0
- package/dist/utils/payload-config-modifier.js.map +1 -0
- package/dist/utils/payload-config-modifier.spec.d.ts +2 -0
- package/dist/utils/payload-config-modifier.spec.d.ts.map +1 -0
- package/dist/utils/payload-config-modifier.spec.js +162 -0
- package/dist/utils/payload-config-modifier.spec.js.map +1 -0
- package/dist/utils/payload-package-check.d.ts +15 -0
- package/dist/utils/payload-package-check.d.ts.map +1 -0
- package/dist/utils/payload-package-check.js +116 -0
- package/dist/utils/payload-package-check.js.map +1 -0
- package/dist/utils/payload-package-check.spec.d.ts +2 -0
- package/dist/utils/payload-package-check.spec.d.ts.map +1 -0
- package/dist/utils/payload-package-check.spec.js +148 -0
- package/dist/utils/payload-package-check.spec.js.map +1 -0
- package/dist/utils/project.d.ts +58 -0
- package/dist/utils/project.d.ts.map +1 -0
- package/dist/utils/project.js +252 -0
- package/dist/utils/project.js.map +1 -0
- package/dist/utils/project.spec.d.ts +2 -0
- package/dist/utils/project.spec.d.ts.map +1 -0
- package/dist/utils/project.spec.js +222 -0
- package/dist/utils/project.spec.js.map +1 -0
- package/dist/utils/s3-upload.d.ts +43 -0
- package/dist/utils/s3-upload.d.ts.map +1 -0
- package/dist/utils/s3-upload.js +128 -0
- package/dist/utils/s3-upload.js.map +1 -0
- package/dist/utils/s3-upload.spec.d.ts +2 -0
- package/dist/utils/s3-upload.spec.d.ts.map +1 -0
- package/dist/utils/s3-upload.spec.js +140 -0
- package/dist/utils/s3-upload.spec.js.map +1 -0
- package/dist/utils/token-display.d.ts +14 -0
- package/dist/utils/token-display.d.ts.map +1 -0
- package/dist/utils/token-display.js +62 -0
- package/dist/utils/token-display.js.map +1 -0
- package/dist/utils/typescript-validator.d.ts +11 -0
- package/dist/utils/typescript-validator.d.ts.map +1 -0
- package/dist/utils/typescript-validator.js +58 -0
- package/dist/utils/typescript-validator.js.map +1 -0
- package/package.json +69 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/config/oauth.ts"],"sourcesContent":["import type { OAuthConfig } from '../auth/types.js'\n\nimport { FIGMA_CLIENT_IDS } from '../constants.js'\n\nexport const URLS: Record<\n 'prod' | 'staging',\n Pick<OAuthConfig, 'authorizationUrl' | 'refreshUrl' | 'tokenUrl'>\n> = {\n prod: {\n authorizationUrl: 'https://www.figma.com/oauth',\n refreshUrl: 'https://api.figma.com/v1/oauth/refresh',\n tokenUrl: 'https://api.figma.com/v1/oauth/token',\n },\n staging: {\n authorizationUrl: 'https://staging.figma.com/oauth',\n refreshUrl: 'https://api.staging.figma.com/v1/oauth/refresh',\n tokenUrl: 'https://api.staging.figma.com/v1/oauth/token',\n },\n}\n\n/**\n * Figma OAuth2 configuration for public CLI client\n *\n * This is a PUBLIC OAuth client using PKCE (Proof Key for Code Exchange).\n * No client secret is used because CLIs cannot securely store secrets.\n * PKCE provides security through the code_verifier/code_challenge mechanism.\n *\n * For production use, register a public OAuth app with Figma.\n * To register an OAuth app, visit: https://www.figma.com/developers/api#oauth2\n */\nexport const OAUTH_CONFIG: OAuthConfig = {\n // OAuth client ID (public client)\n // Uses staging client ID by default since we use staging endpoints\n clientId: process.env.FIGMA_CLIENT_ID || FIGMA_CLIENT_IDS.staging,\n\n // No client secret - this is a public OAuth client using PKCE\n // Public clients cannot securely store secrets in CLI environments\n\n redirectUri: process.env.FIGMA_REDIRECT_URI || 'http://localhost:3000/callback',\n\n // Only current_user:read scope is needed for basic user info\n scopes: ['current_user:read'],\n\n // TODO: Dynamically choose between prod and staging based on environment\n ...URLS.staging,\n}\n\n/**\n * Buffer time (in seconds) before token expiration to consider token as expired\n * This helps avoid using tokens that are about to expire\n */\nexport const TOKEN_EXPIRY_BUFFER_SECONDS = 300 // 5 minutes\n"],"names":["FIGMA_CLIENT_IDS","URLS","prod","authorizationUrl","refreshUrl","tokenUrl","staging","OAUTH_CONFIG","clientId","process","env","FIGMA_CLIENT_ID","redirectUri","FIGMA_REDIRECT_URI","scopes","TOKEN_EXPIRY_BUFFER_SECONDS"],"mappings":"AAEA,SAASA,gBAAgB,QAAQ,kBAAiB;AAElD,OAAO,MAAMC,OAGT;IACFC,MAAM;QACJC,kBAAkB;QAClBC,YAAY;QACZC,UAAU;IACZ;IACAC,SAAS;QACPH,kBAAkB;QAClBC,YAAY;QACZC,UAAU;IACZ;AACF,EAAC;AAED;;;;;;;;;CASC,GACD,OAAO,MAAME,eAA4B;IACvC,kCAAkC;IAClC,mEAAmE;IACnEC,UAAUC,QAAQC,GAAG,CAACC,eAAe,IAAIX,iBAAiBM,OAAO;IAEjE,8DAA8D;IAC9D,mEAAmE;IAEnEM,aAAaH,QAAQC,GAAG,CAACG,kBAAkB,IAAI;IAE/C,6DAA6D;IAC7DC,QAAQ;QAAC;KAAoB;IAE7B,yEAAyE;IACzE,GAAGb,KAAKK,OAAO;AACjB,EAAC;AAED;;;CAGC,GACD,OAAO,MAAMS,8BAA8B,IAAI,YAAY;CAAb"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare const FIGMA_CLIENT_IDS: {
|
|
2
|
+
production: string;
|
|
3
|
+
staging: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const JWKS_URI: {
|
|
6
|
+
production: string;
|
|
7
|
+
staging: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Figma environment (production or staging)
|
|
11
|
+
*/
|
|
12
|
+
export type Environment = 'production' | 'staging';
|
|
13
|
+
/**
|
|
14
|
+
* Get current Figma environment from environment variable
|
|
15
|
+
* Defaults to 'staging' if not specified
|
|
16
|
+
*
|
|
17
|
+
* @returns Current environment
|
|
18
|
+
*/
|
|
19
|
+
export declare function getEnvironment(): Environment;
|
|
20
|
+
/**
|
|
21
|
+
* Get JWKS URI for a given environment
|
|
22
|
+
*
|
|
23
|
+
* @param env - Environment (defaults to current environment)
|
|
24
|
+
* @returns JWKS URI for the environment
|
|
25
|
+
*/
|
|
26
|
+
export declare function getJWKSUri(env?: Environment): string;
|
|
27
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB;;;CAG5B,CAAA;AAED,eAAO,MAAM,QAAQ;;;CAGpB,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,SAAS,CAAA;AAElD;;;;;GAKG;AACH,wBAAgB,cAAc,IAAI,WAAW,CAE5C;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,GAAG,CAAC,EAAE,WAAW,GAAG,MAAM,CAGpD"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export const FIGMA_CLIENT_IDS = {
|
|
2
|
+
production: '',
|
|
3
|
+
staging: 'wqAToBAp4UI9AZ5M6wTfT9'
|
|
4
|
+
};
|
|
5
|
+
export const JWKS_URI = {
|
|
6
|
+
production: 'https://static.figmacontent.com/.well_known/jwks.json',
|
|
7
|
+
staging: 'https://static.figmacontentstaging.com/.well_known/jwks.json'
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Get current Figma environment from environment variable
|
|
11
|
+
* Defaults to 'staging' if not specified
|
|
12
|
+
*
|
|
13
|
+
* @returns Current environment
|
|
14
|
+
*/ export function getEnvironment() {
|
|
15
|
+
return process.env.FIGMA_ENV === 'production' ? 'production' : 'staging';
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Get JWKS URI for a given environment
|
|
19
|
+
*
|
|
20
|
+
* @param env - Environment (defaults to current environment)
|
|
21
|
+
* @returns JWKS URI for the environment
|
|
22
|
+
*/ export function getJWKSUri(env) {
|
|
23
|
+
const environment = env || getEnvironment();
|
|
24
|
+
return JWKS_URI[environment];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/constants.ts"],"sourcesContent":["export const FIGMA_CLIENT_IDS = {\n production: '',\n staging: 'wqAToBAp4UI9AZ5M6wTfT9', // Hard-coded staging client ID\n}\n\nexport const JWKS_URI = {\n production: 'https://static.figmacontent.com/.well_known/jwks.json',\n staging: 'https://static.figmacontentstaging.com/.well_known/jwks.json',\n}\n\n/**\n * Figma environment (production or staging)\n */\nexport type Environment = 'production' | 'staging'\n\n/**\n * Get current Figma environment from environment variable\n * Defaults to 'staging' if not specified\n *\n * @returns Current environment\n */\nexport function getEnvironment(): Environment {\n return process.env.FIGMA_ENV === 'production' ? 'production' : 'staging'\n}\n\n/**\n * Get JWKS URI for a given environment\n *\n * @param env - Environment (defaults to current environment)\n * @returns JWKS URI for the environment\n */\nexport function getJWKSUri(env?: Environment): string {\n const environment = env || getEnvironment()\n return JWKS_URI[environment]\n}\n"],"names":["FIGMA_CLIENT_IDS","production","staging","JWKS_URI","getEnvironment","process","env","FIGMA_ENV","getJWKSUri","environment"],"mappings":"AAAA,OAAO,MAAMA,mBAAmB;IAC9BC,YAAY;IACZC,SAAS;AACX,EAAC;AAED,OAAO,MAAMC,WAAW;IACtBF,YAAY;IACZC,SAAS;AACX,EAAC;AAOD;;;;;CAKC,GACD,OAAO,SAASE;IACd,OAAOC,QAAQC,GAAG,CAACC,SAAS,KAAK,eAAe,eAAe;AACjE;AAEA;;;;;CAKC,GACD,OAAO,SAASC,WAAWF,GAAiB;IAC1C,MAAMG,cAAcH,OAAOF;IAC3B,OAAOD,QAAQ,CAACM,YAAY;AAC9B"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { figmaContentSystem } from './plugin/adapter.js';
|
|
2
|
+
export type { FigmaContentSystemOptions } from './plugin/adapter.js';
|
|
3
|
+
export { buildConfig } from './plugin/build-config.js';
|
|
4
|
+
export type { FigmaConfig } from './plugin/build-config.js';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AACxD,YAAY,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAGpE,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD,YAAY,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["// Export database adapter for advanced use cases\nexport { figmaContentSystem } from './plugin/adapter.js'\nexport type { FigmaContentSystemOptions } from './plugin/adapter.js'\n\n// Export buildConfig wrapper and its config type\nexport { buildConfig } from './plugin/build-config.js'\nexport type { FigmaConfig } from './plugin/build-config.js'\n"],"names":["figmaContentSystem","buildConfig"],"mappings":"AAAA,iDAAiD;AACjD,SAASA,kBAAkB,QAAQ,sBAAqB;AAGxD,iDAAiD;AACjD,SAASC,WAAW,QAAQ,2BAA0B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../src/plugin/adapter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAIjD,MAAM,WAAW,yBAAyB;CAEzC;AAED,wBAAgB,kBAAkB,CAAC,OAAO,GAAE,yBAA8B,GAAG,kBAAkB,CAiJ9F"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/* eslint-disable */ import { createDatabaseAdapter } from 'payload';
|
|
2
|
+
export function figmaContentSystem(options = {}) {
|
|
3
|
+
function adapter({ payload }) {
|
|
4
|
+
return createDatabaseAdapter({
|
|
5
|
+
name: 'figma-content-system',
|
|
6
|
+
defaultIDType: 'text',
|
|
7
|
+
packageName: '@payloadcms/plugin-figma',
|
|
8
|
+
payload,
|
|
9
|
+
// Connection lifecycle
|
|
10
|
+
connect: async ()=>{
|
|
11
|
+
throw new Error('figmaContentSystem.connect() not implemented');
|
|
12
|
+
},
|
|
13
|
+
destroy: async ()=>{
|
|
14
|
+
throw new Error('figmaContentSystem.destroy() not implemented');
|
|
15
|
+
},
|
|
16
|
+
init: async ()=>{
|
|
17
|
+
throw new Error('figmaContentSystem.init() not implemented');
|
|
18
|
+
},
|
|
19
|
+
// Transactions
|
|
20
|
+
beginTransaction: async ()=>{
|
|
21
|
+
throw new Error('figmaContentSystem.beginTransaction() not implemented');
|
|
22
|
+
},
|
|
23
|
+
commitTransaction: async ()=>{
|
|
24
|
+
throw new Error('figmaContentSystem.commitTransaction() not implemented');
|
|
25
|
+
},
|
|
26
|
+
rollbackTransaction: async ()=>{
|
|
27
|
+
throw new Error('figmaContentSystem.rollbackTransaction() not implemented');
|
|
28
|
+
},
|
|
29
|
+
// Collection operations
|
|
30
|
+
count: async ()=>{
|
|
31
|
+
throw new Error('figmaContentSystem.count() not implemented');
|
|
32
|
+
},
|
|
33
|
+
create: async ()=>{
|
|
34
|
+
throw new Error('figmaContentSystem.create() not implemented');
|
|
35
|
+
},
|
|
36
|
+
deleteMany: async ()=>{
|
|
37
|
+
throw new Error('figmaContentSystem.deleteMany() not implemented');
|
|
38
|
+
},
|
|
39
|
+
deleteOne: async ()=>{
|
|
40
|
+
throw new Error('figmaContentSystem.deleteOne() not implemented');
|
|
41
|
+
},
|
|
42
|
+
find: async ()=>{
|
|
43
|
+
throw new Error('figmaContentSystem.find() not implemented');
|
|
44
|
+
},
|
|
45
|
+
findDistinct: async ()=>{
|
|
46
|
+
throw new Error('figmaContentSystem.findDistinct() not implemented');
|
|
47
|
+
},
|
|
48
|
+
findOne: async ()=>{
|
|
49
|
+
throw new Error('figmaContentSystem.findOne() not implemented');
|
|
50
|
+
},
|
|
51
|
+
updateMany: async ()=>{
|
|
52
|
+
throw new Error('figmaContentSystem.updateMany() not implemented');
|
|
53
|
+
},
|
|
54
|
+
updateOne: async ()=>{
|
|
55
|
+
throw new Error('figmaContentSystem.updateOne() not implemented');
|
|
56
|
+
},
|
|
57
|
+
upsert: async ()=>{
|
|
58
|
+
throw new Error('figmaContentSystem.upsert() not implemented');
|
|
59
|
+
},
|
|
60
|
+
// Global operations
|
|
61
|
+
createGlobal: async ()=>{
|
|
62
|
+
throw new Error('figmaContentSystem.createGlobal() not implemented');
|
|
63
|
+
},
|
|
64
|
+
findGlobal: async ()=>{
|
|
65
|
+
throw new Error('figmaContentSystem.findGlobal() not implemented');
|
|
66
|
+
},
|
|
67
|
+
updateGlobal: async ()=>{
|
|
68
|
+
throw new Error('figmaContentSystem.updateGlobal() not implemented');
|
|
69
|
+
},
|
|
70
|
+
// Version operations
|
|
71
|
+
countVersions: async ()=>{
|
|
72
|
+
throw new Error('figmaContentSystem.countVersions() not implemented');
|
|
73
|
+
},
|
|
74
|
+
createVersion: async ()=>{
|
|
75
|
+
throw new Error('figmaContentSystem.createVersion() not implemented');
|
|
76
|
+
},
|
|
77
|
+
deleteVersions: async ()=>{
|
|
78
|
+
throw new Error('figmaContentSystem.deleteVersions() not implemented');
|
|
79
|
+
},
|
|
80
|
+
findVersions: async ()=>{
|
|
81
|
+
throw new Error('figmaContentSystem.findVersions() not implemented');
|
|
82
|
+
},
|
|
83
|
+
updateVersion: async ()=>{
|
|
84
|
+
throw new Error('figmaContentSystem.updateVersion() not implemented');
|
|
85
|
+
},
|
|
86
|
+
// Global version operations
|
|
87
|
+
countGlobalVersions: async ()=>{
|
|
88
|
+
throw new Error('figmaContentSystem.countGlobalVersions() not implemented');
|
|
89
|
+
},
|
|
90
|
+
createGlobalVersion: async ()=>{
|
|
91
|
+
throw new Error('figmaContentSystem.createGlobalVersion() not implemented');
|
|
92
|
+
},
|
|
93
|
+
findGlobalVersions: async ()=>{
|
|
94
|
+
throw new Error('figmaContentSystem.findGlobalVersions() not implemented');
|
|
95
|
+
},
|
|
96
|
+
updateGlobalVersion: async ()=>{
|
|
97
|
+
throw new Error('figmaContentSystem.updateGlobalVersion() not implemented');
|
|
98
|
+
},
|
|
99
|
+
// Draft operations
|
|
100
|
+
queryDrafts: async ()=>{
|
|
101
|
+
throw new Error('figmaContentSystem.queryDrafts() not implemented');
|
|
102
|
+
},
|
|
103
|
+
// Job operations
|
|
104
|
+
updateJobs: async ()=>{
|
|
105
|
+
throw new Error('figmaContentSystem.updateJobs() not implemented');
|
|
106
|
+
},
|
|
107
|
+
// Migration operations
|
|
108
|
+
createMigration: async ()=>{
|
|
109
|
+
throw new Error('figmaContentSystem.createMigration() not implemented');
|
|
110
|
+
},
|
|
111
|
+
migrate: async ()=>{
|
|
112
|
+
throw new Error('figmaContentSystem.migrate() not implemented');
|
|
113
|
+
},
|
|
114
|
+
migrateDown: async ()=>{
|
|
115
|
+
throw new Error('figmaContentSystem.migrateDown() not implemented');
|
|
116
|
+
},
|
|
117
|
+
migrateFresh: async ()=>{
|
|
118
|
+
throw new Error('figmaContentSystem.migrateFresh() not implemented');
|
|
119
|
+
},
|
|
120
|
+
migrateRefresh: async ()=>{
|
|
121
|
+
throw new Error('figmaContentSystem.migrateRefresh() not implemented');
|
|
122
|
+
},
|
|
123
|
+
migrateReset: async ()=>{
|
|
124
|
+
throw new Error('figmaContentSystem.migrateReset() not implemented');
|
|
125
|
+
},
|
|
126
|
+
migrateStatus: async ()=>{
|
|
127
|
+
throw new Error('figmaContentSystem.migrateStatus() not implemented');
|
|
128
|
+
},
|
|
129
|
+
migrationDir: './migrations'
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
return {
|
|
133
|
+
name: 'figma-content-system',
|
|
134
|
+
defaultIDType: 'text',
|
|
135
|
+
init: adapter
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
//# sourceMappingURL=adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/plugin/adapter.ts"],"sourcesContent":["/* eslint-disable */\n\nimport type { DatabaseAdapterObj } from 'payload'\n\nimport { createDatabaseAdapter } from 'payload'\n\nexport interface FigmaContentSystemOptions {\n // Add Figma-specific configuration options here\n}\n\nexport function figmaContentSystem(options: FigmaContentSystemOptions = {}): DatabaseAdapterObj {\n function adapter({ payload }: { payload: any }) {\n return createDatabaseAdapter({\n name: 'figma-content-system',\n defaultIDType: 'text' as const,\n packageName: '@payloadcms/plugin-figma',\n payload,\n\n // Connection lifecycle\n connect: async () => {\n throw new Error('figmaContentSystem.connect() not implemented')\n },\n destroy: async () => {\n throw new Error('figmaContentSystem.destroy() not implemented')\n },\n init: async () => {\n throw new Error('figmaContentSystem.init() not implemented')\n },\n\n // Transactions\n beginTransaction: async () => {\n throw new Error('figmaContentSystem.beginTransaction() not implemented')\n },\n commitTransaction: async () => {\n throw new Error('figmaContentSystem.commitTransaction() not implemented')\n },\n rollbackTransaction: async () => {\n throw new Error('figmaContentSystem.rollbackTransaction() not implemented')\n },\n\n // Collection operations\n count: async () => {\n throw new Error('figmaContentSystem.count() not implemented')\n },\n create: async () => {\n throw new Error('figmaContentSystem.create() not implemented')\n },\n deleteMany: async () => {\n throw new Error('figmaContentSystem.deleteMany() not implemented')\n },\n deleteOne: async () => {\n throw new Error('figmaContentSystem.deleteOne() not implemented')\n },\n find: async () => {\n throw new Error('figmaContentSystem.find() not implemented')\n },\n findDistinct: async () => {\n throw new Error('figmaContentSystem.findDistinct() not implemented')\n },\n findOne: async () => {\n throw new Error('figmaContentSystem.findOne() not implemented')\n },\n updateMany: async () => {\n throw new Error('figmaContentSystem.updateMany() not implemented')\n },\n updateOne: async () => {\n throw new Error('figmaContentSystem.updateOne() not implemented')\n },\n upsert: async () => {\n throw new Error('figmaContentSystem.upsert() not implemented')\n },\n\n // Global operations\n createGlobal: async () => {\n throw new Error('figmaContentSystem.createGlobal() not implemented')\n },\n findGlobal: async () => {\n throw new Error('figmaContentSystem.findGlobal() not implemented')\n },\n updateGlobal: async () => {\n throw new Error('figmaContentSystem.updateGlobal() not implemented')\n },\n\n // Version operations\n countVersions: async () => {\n throw new Error('figmaContentSystem.countVersions() not implemented')\n },\n createVersion: async () => {\n throw new Error('figmaContentSystem.createVersion() not implemented')\n },\n deleteVersions: async () => {\n throw new Error('figmaContentSystem.deleteVersions() not implemented')\n },\n findVersions: async () => {\n throw new Error('figmaContentSystem.findVersions() not implemented')\n },\n updateVersion: async () => {\n throw new Error('figmaContentSystem.updateVersion() not implemented')\n },\n\n // Global version operations\n countGlobalVersions: async () => {\n throw new Error('figmaContentSystem.countGlobalVersions() not implemented')\n },\n createGlobalVersion: async () => {\n throw new Error('figmaContentSystem.createGlobalVersion() not implemented')\n },\n findGlobalVersions: async () => {\n throw new Error('figmaContentSystem.findGlobalVersions() not implemented')\n },\n updateGlobalVersion: async () => {\n throw new Error('figmaContentSystem.updateGlobalVersion() not implemented')\n },\n\n // Draft operations\n queryDrafts: async () => {\n throw new Error('figmaContentSystem.queryDrafts() not implemented')\n },\n\n // Job operations\n updateJobs: async () => {\n throw new Error('figmaContentSystem.updateJobs() not implemented')\n },\n\n // Migration operations\n createMigration: async () => {\n throw new Error('figmaContentSystem.createMigration() not implemented')\n },\n migrate: async () => {\n throw new Error('figmaContentSystem.migrate() not implemented')\n },\n migrateDown: async () => {\n throw new Error('figmaContentSystem.migrateDown() not implemented')\n },\n migrateFresh: async () => {\n throw new Error('figmaContentSystem.migrateFresh() not implemented')\n },\n migrateRefresh: async () => {\n throw new Error('figmaContentSystem.migrateRefresh() not implemented')\n },\n migrateReset: async () => {\n throw new Error('figmaContentSystem.migrateReset() not implemented')\n },\n migrateStatus: async () => {\n throw new Error('figmaContentSystem.migrateStatus() not implemented')\n },\n migrationDir: './migrations',\n })\n }\n\n return {\n name: 'figma-content-system',\n defaultIDType: 'text' as const,\n init: adapter,\n }\n}\n"],"names":["createDatabaseAdapter","figmaContentSystem","options","adapter","payload","name","defaultIDType","packageName","connect","Error","destroy","init","beginTransaction","commitTransaction","rollbackTransaction","count","create","deleteMany","deleteOne","find","findDistinct","findOne","updateMany","updateOne","upsert","createGlobal","findGlobal","updateGlobal","countVersions","createVersion","deleteVersions","findVersions","updateVersion","countGlobalVersions","createGlobalVersion","findGlobalVersions","updateGlobalVersion","queryDrafts","updateJobs","createMigration","migrate","migrateDown","migrateFresh","migrateRefresh","migrateReset","migrateStatus","migrationDir"],"mappings":"AAAA,kBAAkB,GAIlB,SAASA,qBAAqB,QAAQ,UAAS;AAM/C,OAAO,SAASC,mBAAmBC,UAAqC,CAAC,CAAC;IACxE,SAASC,QAAQ,EAAEC,OAAO,EAAoB;QAC5C,OAAOJ,sBAAsB;YAC3BK,MAAM;YACNC,eAAe;YACfC,aAAa;YACbH;YAEA,uBAAuB;YACvBI,SAAS;gBACP,MAAM,IAAIC,MAAM;YAClB;YACAC,SAAS;gBACP,MAAM,IAAID,MAAM;YAClB;YACAE,MAAM;gBACJ,MAAM,IAAIF,MAAM;YAClB;YAEA,eAAe;YACfG,kBAAkB;gBAChB,MAAM,IAAIH,MAAM;YAClB;YACAI,mBAAmB;gBACjB,MAAM,IAAIJ,MAAM;YAClB;YACAK,qBAAqB;gBACnB,MAAM,IAAIL,MAAM;YAClB;YAEA,wBAAwB;YACxBM,OAAO;gBACL,MAAM,IAAIN,MAAM;YAClB;YACAO,QAAQ;gBACN,MAAM,IAAIP,MAAM;YAClB;YACAQ,YAAY;gBACV,MAAM,IAAIR,MAAM;YAClB;YACAS,WAAW;gBACT,MAAM,IAAIT,MAAM;YAClB;YACAU,MAAM;gBACJ,MAAM,IAAIV,MAAM;YAClB;YACAW,cAAc;gBACZ,MAAM,IAAIX,MAAM;YAClB;YACAY,SAAS;gBACP,MAAM,IAAIZ,MAAM;YAClB;YACAa,YAAY;gBACV,MAAM,IAAIb,MAAM;YAClB;YACAc,WAAW;gBACT,MAAM,IAAId,MAAM;YAClB;YACAe,QAAQ;gBACN,MAAM,IAAIf,MAAM;YAClB;YAEA,oBAAoB;YACpBgB,cAAc;gBACZ,MAAM,IAAIhB,MAAM;YAClB;YACAiB,YAAY;gBACV,MAAM,IAAIjB,MAAM;YAClB;YACAkB,cAAc;gBACZ,MAAM,IAAIlB,MAAM;YAClB;YAEA,qBAAqB;YACrBmB,eAAe;gBACb,MAAM,IAAInB,MAAM;YAClB;YACAoB,eAAe;gBACb,MAAM,IAAIpB,MAAM;YAClB;YACAqB,gBAAgB;gBACd,MAAM,IAAIrB,MAAM;YAClB;YACAsB,cAAc;gBACZ,MAAM,IAAItB,MAAM;YAClB;YACAuB,eAAe;gBACb,MAAM,IAAIvB,MAAM;YAClB;YAEA,4BAA4B;YAC5BwB,qBAAqB;gBACnB,MAAM,IAAIxB,MAAM;YAClB;YACAyB,qBAAqB;gBACnB,MAAM,IAAIzB,MAAM;YAClB;YACA0B,oBAAoB;gBAClB,MAAM,IAAI1B,MAAM;YAClB;YACA2B,qBAAqB;gBACnB,MAAM,IAAI3B,MAAM;YAClB;YAEA,mBAAmB;YACnB4B,aAAa;gBACX,MAAM,IAAI5B,MAAM;YAClB;YAEA,iBAAiB;YACjB6B,YAAY;gBACV,MAAM,IAAI7B,MAAM;YAClB;YAEA,uBAAuB;YACvB8B,iBAAiB;gBACf,MAAM,IAAI9B,MAAM;YAClB;YACA+B,SAAS;gBACP,MAAM,IAAI/B,MAAM;YAClB;YACAgC,aAAa;gBACX,MAAM,IAAIhC,MAAM;YAClB;YACAiC,cAAc;gBACZ,MAAM,IAAIjC,MAAM;YAClB;YACAkC,gBAAgB;gBACd,MAAM,IAAIlC,MAAM;YAClB;YACAmC,cAAc;gBACZ,MAAM,IAAInC,MAAM;YAClB;YACAoC,eAAe;gBACb,MAAM,IAAIpC,MAAM;YAClB;YACAqC,cAAc;QAChB;IACF;IAEA,OAAO;QACLzC,MAAM;QACNC,eAAe;QACfK,MAAMR;IACR;AACF"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Config, SanitizedConfig } from 'payload';
|
|
2
|
+
/**
|
|
3
|
+
* Configuration type for Payload projects on the Figma platform.
|
|
4
|
+
*
|
|
5
|
+
* Differences from standard Payload Config:
|
|
6
|
+
* - `db`: Omitted (auto-injected by Figma platform)
|
|
7
|
+
* - `secret`: Omitted (auto-injected by Figma platform)
|
|
8
|
+
* - `editor`: Optional (defaults to lexicalEditor() if not provided)
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* // Minimal config
|
|
12
|
+
* const config: FigmaConfig = {
|
|
13
|
+
* collections: [...]
|
|
14
|
+
* }
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* // With custom editor
|
|
18
|
+
* const config: FigmaConfig = {
|
|
19
|
+
* collections: [...],
|
|
20
|
+
* editor: lexicalEditor({ features: [...] })
|
|
21
|
+
* }
|
|
22
|
+
*/
|
|
23
|
+
export type FigmaConfig = {
|
|
24
|
+
editor?: Config['editor'];
|
|
25
|
+
} & Omit<Config, 'db' | 'editor' | 'secret'>;
|
|
26
|
+
/**
|
|
27
|
+
* Figma platform wrapper for Payload's buildConfig.
|
|
28
|
+
* Automatically injects:
|
|
29
|
+
* - Figma database adapter
|
|
30
|
+
* - Secret (platform-provided)
|
|
31
|
+
* - Default lexicalEditor (if no custom editor specified)
|
|
32
|
+
*
|
|
33
|
+
* @param config - Payload configuration (db and secret omitted, editor optional)
|
|
34
|
+
* @returns Promise<SanitizedConfig> - Built Payload configuration
|
|
35
|
+
*/
|
|
36
|
+
export declare function buildConfig(config: FigmaConfig): Promise<SanitizedConfig>;
|
|
37
|
+
//# sourceMappingURL=build-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-config.d.ts","sourceRoot":"","sources":["../../src/plugin/build-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAOtD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAA;CAC1B,GAAG,IAAI,CAAC,MAAM,EAAE,IAAI,GAAG,QAAQ,GAAG,QAAQ,CAAC,CAAA;AAE5C;;;;;;;;;GASG;AACH,wBAAsB,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,eAAe,CAAC,CAW/E"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { lexicalEditor } from '@payloadcms/richtext-lexical';
|
|
2
|
+
import { buildConfig as payloadBuildConfig } from 'payload';
|
|
3
|
+
import { figmaContentSystem } from './adapter.js';
|
|
4
|
+
/**
|
|
5
|
+
* Figma platform wrapper for Payload's buildConfig.
|
|
6
|
+
* Automatically injects:
|
|
7
|
+
* - Figma database adapter
|
|
8
|
+
* - Secret (platform-provided)
|
|
9
|
+
* - Default lexicalEditor (if no custom editor specified)
|
|
10
|
+
*
|
|
11
|
+
* @param config - Payload configuration (db and secret omitted, editor optional)
|
|
12
|
+
* @returns Promise<SanitizedConfig> - Built Payload configuration
|
|
13
|
+
*/ export async function buildConfig(config) {
|
|
14
|
+
// Build complete config with Figma platform defaults
|
|
15
|
+
const configWithFigmaDefaults = {
|
|
16
|
+
...config,
|
|
17
|
+
db: figmaContentSystem(),
|
|
18
|
+
editor: config.editor ?? lexicalEditor(),
|
|
19
|
+
secret: 'MY_SECRET'
|
|
20
|
+
};
|
|
21
|
+
// Delegate to Payload's buildConfig
|
|
22
|
+
return await payloadBuildConfig(configWithFigmaDefaults);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=build-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/plugin/build-config.ts"],"sourcesContent":["import type { Config, SanitizedConfig } from 'payload'\n\nimport { lexicalEditor } from '@payloadcms/richtext-lexical'\nimport { buildConfig as payloadBuildConfig } from 'payload'\n\nimport { figmaContentSystem } from './adapter.js'\n\n/**\n * Configuration type for Payload projects on the Figma platform.\n *\n * Differences from standard Payload Config:\n * - `db`: Omitted (auto-injected by Figma platform)\n * - `secret`: Omitted (auto-injected by Figma platform)\n * - `editor`: Optional (defaults to lexicalEditor() if not provided)\n *\n * @example\n * // Minimal config\n * const config: FigmaConfig = {\n * collections: [...]\n * }\n *\n * @example\n * // With custom editor\n * const config: FigmaConfig = {\n * collections: [...],\n * editor: lexicalEditor({ features: [...] })\n * }\n */\nexport type FigmaConfig = {\n editor?: Config['editor']\n} & Omit<Config, 'db' | 'editor' | 'secret'>\n\n/**\n * Figma platform wrapper for Payload's buildConfig.\n * Automatically injects:\n * - Figma database adapter\n * - Secret (platform-provided)\n * - Default lexicalEditor (if no custom editor specified)\n *\n * @param config - Payload configuration (db and secret omitted, editor optional)\n * @returns Promise<SanitizedConfig> - Built Payload configuration\n */\nexport async function buildConfig(config: FigmaConfig): Promise<SanitizedConfig> {\n // Build complete config with Figma platform defaults\n const configWithFigmaDefaults: Config = {\n ...config,\n db: figmaContentSystem(),\n editor: config.editor ?? lexicalEditor(),\n secret: 'MY_SECRET',\n }\n\n // Delegate to Payload's buildConfig\n return await payloadBuildConfig(configWithFigmaDefaults)\n}\n"],"names":["lexicalEditor","buildConfig","payloadBuildConfig","figmaContentSystem","config","configWithFigmaDefaults","db","editor","secret"],"mappings":"AAEA,SAASA,aAAa,QAAQ,+BAA8B;AAC5D,SAASC,eAAeC,kBAAkB,QAAQ,UAAS;AAE3D,SAASC,kBAAkB,QAAQ,eAAc;AA2BjD;;;;;;;;;CASC,GACD,OAAO,eAAeF,YAAYG,MAAmB;IACnD,qDAAqD;IACrD,MAAMC,0BAAkC;QACtC,GAAGD,MAAM;QACTE,IAAIH;QACJI,QAAQH,OAAOG,MAAM,IAAIP;QACzBQ,QAAQ;IACV;IAEA,oCAAoC;IACpC,OAAO,MAAMN,mBAAmBG;AAClC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-config.spec.d.ts","sourceRoot":"","sources":["../../src/plugin/build-config.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { lexicalEditor } from '@payloadcms/richtext-lexical';
|
|
2
|
+
import { describe, expect, it } from 'vitest';
|
|
3
|
+
import { buildConfig } from './build-config.js';
|
|
4
|
+
describe('buildConfig', ()=>{
|
|
5
|
+
it('should inject figmaContentSystem as db adapter', async ()=>{
|
|
6
|
+
const config = {
|
|
7
|
+
collections: []
|
|
8
|
+
};
|
|
9
|
+
const result = await buildConfig(config);
|
|
10
|
+
expect(result.db).toBeDefined();
|
|
11
|
+
expect(result.db.name).toBe('figma-content-system');
|
|
12
|
+
});
|
|
13
|
+
it('should inject secret', async ()=>{
|
|
14
|
+
const config = {
|
|
15
|
+
collections: []
|
|
16
|
+
};
|
|
17
|
+
const result = await buildConfig(config);
|
|
18
|
+
expect(result.secret).toBe('MY_SECRET');
|
|
19
|
+
});
|
|
20
|
+
it('should inject default lexicalEditor when no editor provided', async ()=>{
|
|
21
|
+
const config = {
|
|
22
|
+
collections: []
|
|
23
|
+
};
|
|
24
|
+
const result = await buildConfig(config);
|
|
25
|
+
expect(result.editor).toBeDefined();
|
|
26
|
+
// Lexical editor should be present
|
|
27
|
+
expect(typeof result.editor).toBe('object');
|
|
28
|
+
});
|
|
29
|
+
it('should preserve custom editor from user config', async ()=>{
|
|
30
|
+
const customEditor = lexicalEditor({
|
|
31
|
+
features: []
|
|
32
|
+
});
|
|
33
|
+
const config = {
|
|
34
|
+
collections: [],
|
|
35
|
+
editor: customEditor
|
|
36
|
+
};
|
|
37
|
+
const result = await buildConfig(config);
|
|
38
|
+
// Should accept and process the custom editor without error
|
|
39
|
+
expect(result.editor).toBeDefined();
|
|
40
|
+
expect(typeof result.editor).toBe('object');
|
|
41
|
+
// Verify it's a lexical editor (has CellComponent property)
|
|
42
|
+
expect(result.editor).toHaveProperty('CellComponent');
|
|
43
|
+
});
|
|
44
|
+
it('should preserve other user configuration', async ()=>{
|
|
45
|
+
const config = {
|
|
46
|
+
collections: [
|
|
47
|
+
{
|
|
48
|
+
slug: 'posts',
|
|
49
|
+
fields: [
|
|
50
|
+
{
|
|
51
|
+
name: 'title',
|
|
52
|
+
type: 'text'
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
globals: [
|
|
58
|
+
{
|
|
59
|
+
slug: 'settings',
|
|
60
|
+
fields: []
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
};
|
|
64
|
+
const result = await buildConfig(config);
|
|
65
|
+
// Should preserve collections and globals
|
|
66
|
+
expect(result.collections).toBeDefined();
|
|
67
|
+
expect(result.collections.length).toBeGreaterThan(0);
|
|
68
|
+
expect(result.globals).toBeDefined();
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
//# sourceMappingURL=build-config.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/plugin/build-config.spec.ts"],"sourcesContent":["import { lexicalEditor } from '@payloadcms/richtext-lexical'\nimport { describe, expect, it } from 'vitest'\n\nimport type { FigmaConfig } from './build-config.js'\n\nimport { buildConfig } from './build-config.js'\n\ndescribe('buildConfig', () => {\n it('should inject figmaContentSystem as db adapter', async () => {\n const config: FigmaConfig = { collections: [] }\n const result = await buildConfig(config)\n\n expect(result.db).toBeDefined()\n expect(result.db.name).toBe('figma-content-system')\n })\n\n it('should inject secret', async () => {\n const config: FigmaConfig = { collections: [] }\n const result = await buildConfig(config)\n\n expect(result.secret).toBe('MY_SECRET')\n })\n\n it('should inject default lexicalEditor when no editor provided', async () => {\n const config: FigmaConfig = { collections: [] }\n const result = await buildConfig(config)\n\n expect(result.editor).toBeDefined()\n // Lexical editor should be present\n expect(typeof result.editor).toBe('object')\n })\n\n it('should preserve custom editor from user config', async () => {\n const customEditor = lexicalEditor({\n features: [], // Empty features to make it distinct\n })\n\n const config: FigmaConfig = {\n collections: [],\n editor: customEditor,\n }\n\n const result = await buildConfig(config)\n\n // Should accept and process the custom editor without error\n expect(result.editor).toBeDefined()\n expect(typeof result.editor).toBe('object')\n // Verify it's a lexical editor (has CellComponent property)\n expect(result.editor).toHaveProperty('CellComponent')\n })\n\n it('should preserve other user configuration', async () => {\n const config: FigmaConfig = {\n collections: [\n {\n slug: 'posts',\n fields: [\n {\n name: 'title',\n type: 'text',\n },\n ],\n },\n ],\n globals: [\n {\n slug: 'settings',\n fields: [],\n },\n ],\n }\n\n const result = await buildConfig(config)\n\n // Should preserve collections and globals\n expect(result.collections).toBeDefined()\n expect(result.collections.length).toBeGreaterThan(0)\n expect(result.globals).toBeDefined()\n })\n})\n"],"names":["lexicalEditor","describe","expect","it","buildConfig","config","collections","result","db","toBeDefined","name","toBe","secret","editor","customEditor","features","toHaveProperty","slug","fields","type","globals","length","toBeGreaterThan"],"mappings":"AAAA,SAASA,aAAa,QAAQ,+BAA8B;AAC5D,SAASC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,SAAQ;AAI7C,SAASC,WAAW,QAAQ,oBAAmB;AAE/CH,SAAS,eAAe;IACtBE,GAAG,kDAAkD;QACnD,MAAME,SAAsB;YAAEC,aAAa,EAAE;QAAC;QAC9C,MAAMC,SAAS,MAAMH,YAAYC;QAEjCH,OAAOK,OAAOC,EAAE,EAAEC,WAAW;QAC7BP,OAAOK,OAAOC,EAAE,CAACE,IAAI,EAAEC,IAAI,CAAC;IAC9B;IAEAR,GAAG,wBAAwB;QACzB,MAAME,SAAsB;YAAEC,aAAa,EAAE;QAAC;QAC9C,MAAMC,SAAS,MAAMH,YAAYC;QAEjCH,OAAOK,OAAOK,MAAM,EAAED,IAAI,CAAC;IAC7B;IAEAR,GAAG,+DAA+D;QAChE,MAAME,SAAsB;YAAEC,aAAa,EAAE;QAAC;QAC9C,MAAMC,SAAS,MAAMH,YAAYC;QAEjCH,OAAOK,OAAOM,MAAM,EAAEJ,WAAW;QACjC,mCAAmC;QACnCP,OAAO,OAAOK,OAAOM,MAAM,EAAEF,IAAI,CAAC;IACpC;IAEAR,GAAG,kDAAkD;QACnD,MAAMW,eAAed,cAAc;YACjCe,UAAU,EAAE;QACd;QAEA,MAAMV,SAAsB;YAC1BC,aAAa,EAAE;YACfO,QAAQC;QACV;QAEA,MAAMP,SAAS,MAAMH,YAAYC;QAEjC,4DAA4D;QAC5DH,OAAOK,OAAOM,MAAM,EAAEJ,WAAW;QACjCP,OAAO,OAAOK,OAAOM,MAAM,EAAEF,IAAI,CAAC;QAClC,4DAA4D;QAC5DT,OAAOK,OAAOM,MAAM,EAAEG,cAAc,CAAC;IACvC;IAEAb,GAAG,4CAA4C;QAC7C,MAAME,SAAsB;YAC1BC,aAAa;gBACX;oBACEW,MAAM;oBACNC,QAAQ;wBACN;4BACER,MAAM;4BACNS,MAAM;wBACR;qBACD;gBACH;aACD;YACDC,SAAS;gBACP;oBACEH,MAAM;oBACNC,QAAQ,EAAE;gBACZ;aACD;QACH;QAEA,MAAMX,SAAS,MAAMH,YAAYC;QAEjC,0CAA0C;QAC1CH,OAAOK,OAAOD,WAAW,EAAEG,WAAW;QACtCP,OAAOK,OAAOD,WAAW,CAACe,MAAM,EAAEC,eAAe,CAAC;QAClDpB,OAAOK,OAAOa,OAAO,EAAEX,WAAW;IACpC;AACF"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Figma CMS Configuration Types
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Configuration stored in figma.config.json
|
|
6
|
+
*/
|
|
7
|
+
export interface FigmaConfig {
|
|
8
|
+
/** Domain for the CMS instance */
|
|
9
|
+
domain: string;
|
|
10
|
+
/** Optional custom subdomain */
|
|
11
|
+
subdomain?: string;
|
|
12
|
+
/** Tenant ID from Control Plane */
|
|
13
|
+
tenantId: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Tenant instance from Control Plane API
|
|
17
|
+
*/
|
|
18
|
+
export interface Tenant {
|
|
19
|
+
/** Creation timestamp */
|
|
20
|
+
createdAt?: string;
|
|
21
|
+
/** Domain name (e.g., my-cms.figmacms.com) */
|
|
22
|
+
domain: string;
|
|
23
|
+
/** Unique tenant ID */
|
|
24
|
+
id: string;
|
|
25
|
+
/** Parent ID */
|
|
26
|
+
parentId: string;
|
|
27
|
+
/** Parent type (team, org, workspace) */
|
|
28
|
+
parentType: 'org' | 'team' | 'workspace';
|
|
29
|
+
/** Tenant status */
|
|
30
|
+
status: 'active' | 'inactive' | 'provisioning';
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Project information from detection
|
|
34
|
+
*/
|
|
35
|
+
export interface ProjectInfo {
|
|
36
|
+
/** Whether Payload is installed */
|
|
37
|
+
hasPayload: boolean;
|
|
38
|
+
/** Package manager detected (npm, pnpm, yarn) */
|
|
39
|
+
packageManager?: 'npm' | 'pnpm' | 'yarn';
|
|
40
|
+
/** Project root path */
|
|
41
|
+
path: string;
|
|
42
|
+
/** Payload version if installed */
|
|
43
|
+
payloadVersion?: string;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,kCAAkC;IAClC,MAAM,EAAE,MAAM,CAAA;IACd,gCAAgC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,mCAAmC;IACnC,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB,yBAAyB;IACzB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,8CAA8C;IAC9C,MAAM,EAAE,MAAM,CAAA;IACd,uBAAuB;IACvB,EAAE,EAAE,MAAM,CAAA;IACV,gBAAgB;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,yCAAyC;IACzC,UAAU,EAAE,KAAK,GAAG,MAAM,GAAG,WAAW,CAAA;IACxC,oBAAoB;IACpB,MAAM,EAAE,QAAQ,GAAG,UAAU,GAAG,cAAc,CAAA;CAC/C;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,mCAAmC;IACnC,UAAU,EAAE,OAAO,CAAA;IACnB,iDAAiD;IACjD,cAAc,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,CAAA;IACxC,wBAAwB;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,mCAAmC;IACnC,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/types/config.ts"],"sourcesContent":["/**\n * Figma CMS Configuration Types\n */\n\n/**\n * Configuration stored in figma.config.json\n */\nexport interface FigmaConfig {\n /** Domain for the CMS instance */\n domain: string\n /** Optional custom subdomain */\n subdomain?: string\n /** Tenant ID from Control Plane */\n tenantId: string\n}\n\n/**\n * Tenant instance from Control Plane API\n */\nexport interface Tenant {\n /** Creation timestamp */\n createdAt?: string\n /** Domain name (e.g., my-cms.figmacms.com) */\n domain: string\n /** Unique tenant ID */\n id: string\n /** Parent ID */\n parentId: string\n /** Parent type (team, org, workspace) */\n parentType: 'org' | 'team' | 'workspace'\n /** Tenant status */\n status: 'active' | 'inactive' | 'provisioning'\n}\n\n/**\n * Project information from detection\n */\nexport interface ProjectInfo {\n /** Whether Payload is installed */\n hasPayload: boolean\n /** Package manager detected (npm, pnpm, yarn) */\n packageManager?: 'npm' | 'pnpm' | 'yarn'\n /** Project root path */\n path: string\n /** Payload version if installed */\n payloadVersion?: string\n}\n"],"names":[],"mappings":"AAAA;;CAEC,GAED;;CAEC,GA4BD;;CAEC,GACD,WASC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type arg from 'arg';
|
|
2
|
+
export interface Args extends arg.Spec {
|
|
3
|
+
'--debug': BooleanConstructor;
|
|
4
|
+
'--force': BooleanConstructor;
|
|
5
|
+
'--help': BooleanConstructor;
|
|
6
|
+
'--list': BooleanConstructor;
|
|
7
|
+
'--logout': BooleanConstructor;
|
|
8
|
+
'--yes': BooleanConstructor;
|
|
9
|
+
'-f': string;
|
|
10
|
+
'-h': string;
|
|
11
|
+
'-y': string;
|
|
12
|
+
}
|
|
13
|
+
export type CliArgs = arg.Result<Args>;
|
|
14
|
+
export type ProjectTemplate = GitTemplate | PluginTemplate;
|
|
15
|
+
export type ProjectExample = {
|
|
16
|
+
name: string;
|
|
17
|
+
url: string;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Template that is cloned verbatim from a git repo
|
|
21
|
+
* Performs .env manipulation based upon input
|
|
22
|
+
*/
|
|
23
|
+
export interface GitTemplate extends Template {
|
|
24
|
+
type: 'starter';
|
|
25
|
+
url: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Type specifically for the plugin template
|
|
29
|
+
* No .env manipulation is done
|
|
30
|
+
*/
|
|
31
|
+
export interface PluginTemplate extends Template {
|
|
32
|
+
type: 'plugin';
|
|
33
|
+
url: string;
|
|
34
|
+
}
|
|
35
|
+
interface Template {
|
|
36
|
+
description?: string;
|
|
37
|
+
name: string;
|
|
38
|
+
type: ProjectTemplate['type'];
|
|
39
|
+
}
|
|
40
|
+
export type PackageManager = 'bun' | 'npm' | 'pnpm' | 'yarn';
|
|
41
|
+
export type DbType = 'd1-sqlite' | 'mongodb' | 'postgres' | 'sqlite' | 'vercel-postgres';
|
|
42
|
+
export type DbDetails = {
|
|
43
|
+
dbUri?: string;
|
|
44
|
+
type: DbType;
|
|
45
|
+
};
|
|
46
|
+
export type EditorType = 'lexical' | 'slate';
|
|
47
|
+
export type NextAppDetails = {
|
|
48
|
+
hasTopLevelLayout: boolean;
|
|
49
|
+
isPayloadInstalled?: boolean;
|
|
50
|
+
isSrcDir: boolean;
|
|
51
|
+
isSupportedNextVersion: boolean;
|
|
52
|
+
nextAppDir?: string;
|
|
53
|
+
nextConfigPath?: string;
|
|
54
|
+
nextConfigType?: NextConfigType;
|
|
55
|
+
nextVersion: null | string;
|
|
56
|
+
};
|
|
57
|
+
export type NextConfigType = 'cjs' | 'esm' | 'ts';
|
|
58
|
+
export type StorageAdapterType = 'localDisk' | 'r2Storage' | 'vercelBlobStorage';
|
|
59
|
+
export {};
|
|
60
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,KAAK,CAAA;AAE1B,MAAM,WAAW,IAAK,SAAQ,GAAG,CAAC,IAAI;IACpC,SAAS,EAAE,kBAAkB,CAAA;IAC7B,SAAS,EAAE,kBAAkB,CAAA;IAC7B,QAAQ,EAAE,kBAAkB,CAAA;IAC5B,QAAQ,EAAE,kBAAkB,CAAA;IAC5B,UAAU,EAAE,kBAAkB,CAAA;IAC9B,OAAO,EAAE,kBAAkB,CAAA;IAI3B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;AAEtC,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,cAAc,CAAA;AAE1D,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AAED;;;GAGG;AACH,MAAM,WAAW,WAAY,SAAQ,QAAQ;IAC3C,IAAI,EAAE,SAAS,CAAA;IACf,GAAG,EAAE,MAAM,CAAA;CACZ;AAED;;;GAGG;AACH,MAAM,WAAW,cAAe,SAAQ,QAAQ;IAC9C,IAAI,EAAE,QAAQ,CAAA;IACd,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,UAAU,QAAQ;IAChB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,eAAe,CAAC,MAAM,CAAC,CAAA;CAC9B;AAED,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAA;AAE5D,MAAM,MAAM,MAAM,GAAG,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,GAAG,iBAAiB,CAAA;AAExF,MAAM,MAAM,SAAS,GAAG;IACtB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,OAAO,CAAA;AAE5C,MAAM,MAAM,cAAc,GAAG;IAC3B,iBAAiB,EAAE,OAAO,CAAA;IAC1B,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B,QAAQ,EAAE,OAAO,CAAA;IACjB,sBAAsB,EAAE,OAAO,CAAA;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,WAAW,EAAE,IAAI,GAAG,MAAM,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,KAAK,GAAG,IAAI,CAAA;AAEjD,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,WAAW,GAAG,mBAAmB,CAAA"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get file size in bytes
|
|
3
|
+
*
|
|
4
|
+
* @param filePath - Absolute path to file
|
|
5
|
+
* @returns File size in bytes
|
|
6
|
+
*/
|
|
7
|
+
export declare function getFileSize(filePath: string): Promise<number>;
|
|
8
|
+
/**
|
|
9
|
+
* Collect all static asset paths from .next/static
|
|
10
|
+
*
|
|
11
|
+
* Returns paths relative to project root, formatted for S3:
|
|
12
|
+
* - `.next/static/chunks/main.js` → `_next/static/chunks/main.js`
|
|
13
|
+
*
|
|
14
|
+
* @param projectPath - Path to project root
|
|
15
|
+
* @returns Array of static asset paths (using _next prefix)
|
|
16
|
+
*/
|
|
17
|
+
export declare function collectStaticAssets(projectPath: string): Promise<string[]>;
|
|
18
|
+
/**
|
|
19
|
+
* Create Lambda deployment zip using build_for_lambda.sh
|
|
20
|
+
*
|
|
21
|
+
* This script:
|
|
22
|
+
* - Copies static files to standalone build
|
|
23
|
+
* - Creates lambda.zip from .next/standalone/
|
|
24
|
+
* - Places zip at project root
|
|
25
|
+
*
|
|
26
|
+
* @param projectPath - Path to project root
|
|
27
|
+
* @throws Error if script missing or execution fails
|
|
28
|
+
*/
|
|
29
|
+
export declare function createLambdaZip(projectPath: string): Promise<void>;
|
|
30
|
+
//# sourceMappingURL=asset-collection.d.ts.map
|
|
@@ -0,0 +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"}
|