@payloadcms/figma 0.1.0-internal.e071575 → 1.0.0-beta.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 +1 -1
- package/dist/{utils → adapters}/asset-collection.d.ts +17 -3
- package/dist/adapters/asset-collection.js +242 -0
- package/dist/{utils → adapters}/build-lambda-zip.d.ts +8 -7
- package/dist/adapters/build-lambda-zip.js +111 -0
- package/dist/adapters/configureNextjsCache.d.ts +8 -0
- package/dist/adapters/configureNextjsCache.js +55 -0
- package/dist/adapters/deploy-output/inspectNextjsOutput/getNextRelativeAppDir.d.ts +1 -0
- package/dist/adapters/deploy-output/inspectNextjsOutput/getNextRelativeAppDir.js +15 -0
- package/dist/adapters/deploy-output/inspectNextjsOutput.d.ts +12 -0
- package/dist/adapters/deploy-output/inspectNextjsOutput.js +28 -0
- package/dist/adapters/deploy-output/inspectNitroOutput.d.ts +9 -0
- package/dist/adapters/deploy-output/inspectNitroOutput.js +13 -0
- package/dist/adapters/deploy-output/isFile.d.ts +1 -0
- package/dist/adapters/deploy-output/isFile.js +4 -0
- package/dist/adapters/deploy-output/readJson.d.ts +1 -0
- package/dist/adapters/deploy-output/readJson.js +9 -0
- package/dist/adapters/deploy-output/resolveNitroOutputLayout.d.ts +8 -0
- package/dist/adapters/deploy-output/resolveNitroOutputLayout.js +16 -0
- package/dist/adapters/deploy-output/resolveOutputPath.d.ts +2 -0
- package/dist/adapters/deploy-output/resolveOutputPath.js +9 -0
- package/dist/adapters/deploy-output/resolveWithin.d.ts +1 -0
- package/dist/adapters/deploy-output/resolveWithin.js +12 -0
- package/dist/adapters/fs-utils.d.ts +39 -0
- package/dist/adapters/fs-utils.js +135 -0
- package/dist/adapters/index.d.ts +4 -0
- package/dist/adapters/index.js +3 -0
- package/dist/adapters/lambda-runtime/nextjs-cache.d.ts +40 -0
- package/dist/adapters/lambda-runtime/nextjs-cache.js +174 -0
- package/dist/adapters/nextjs.d.ts +12 -0
- package/dist/adapters/nextjs.js +67 -0
- package/dist/adapters/nitro.d.ts +8 -0
- package/dist/adapters/nitro.js +193 -0
- package/dist/adapters/secret-files.d.ts +25 -0
- package/dist/adapters/secret-files.js +50 -0
- package/dist/adapters/types.d.ts +42 -0
- package/dist/adapters/types.js +1 -0
- package/dist/{utils/adapters → adapters}/vite.d.ts +2 -2
- package/dist/adapters/vite.js +33 -0
- package/dist/api/check-project-subdomain-availability.d.ts +12 -0
- package/dist/api/check-project-subdomain-availability.js +32 -0
- package/dist/api/control-plane-error.d.ts +6 -0
- package/dist/api/control-plane-error.js +8 -0
- package/dist/api/control-plane-fetch.d.ts +7 -0
- package/dist/api/control-plane-fetch.js +37 -0
- package/dist/api/control-plane.d.ts +12 -9
- package/dist/api/control-plane.js +28 -48
- package/dist/api/create-project.d.ts +18 -0
- package/dist/api/create-project.js +37 -0
- package/dist/api/list-project-workspaces.d.ts +8 -0
- package/dist/api/list-project-workspaces.js +28 -0
- package/dist/api/project-resource-type.d.ts +1 -0
- package/dist/api/project-resource-type.js +1 -0
- package/dist/auth/headless-oauth-flow.d.ts +23 -0
- package/dist/auth/headless-oauth-flow.js +73 -0
- package/dist/auth/oauth-flow.d.ts +2 -0
- package/dist/auth/oauth-flow.js +30 -8
- package/dist/auth/refresh.js +12 -12
- package/dist/auth/requested-scopes.d.ts +1 -0
- package/dist/auth/requested-scopes.js +3 -0
- package/dist/auth/token-store.d.ts +20 -1
- package/dist/auth/token-store.js +47 -0
- package/dist/auth/types.d.ts +17 -3
- package/dist/cli.d.ts +39 -0
- package/dist/cli.js +71 -36
- package/dist/commands/bootstrap.js +5 -1
- package/dist/commands/build-lambda-zip.js +1 -1
- package/dist/commands/deploy.d.ts +12 -0
- package/dist/commands/deploy.js +63 -25
- package/dist/commands/detect-project-resource-type.d.ts +3 -0
- package/dist/commands/detect-project-resource-type.js +28 -0
- package/dist/commands/init.d.ts +2 -2
- package/dist/commands/init.js +235 -80
- package/dist/commands/login.d.ts +11 -1
- package/dist/commands/login.js +66 -4
- package/dist/commands/prompt-to-create-project/format-project-subdomain.d.ts +1 -0
- package/dist/commands/prompt-to-create-project/format-project-subdomain.js +3 -0
- package/dist/commands/prompt-to-create-project/format-unavailable-subdomain-reason.d.ts +1 -0
- package/dist/commands/prompt-to-create-project/format-unavailable-subdomain-reason.js +7 -0
- package/dist/commands/prompt-to-create-project/get-default-project-name.d.ts +1 -0
- package/dist/commands/prompt-to-create-project/get-default-project-name.js +13 -0
- package/dist/commands/prompt-to-create-project/prompt-for-available-subdomain.d.ts +7 -0
- package/dist/commands/prompt-to-create-project/prompt-for-available-subdomain.js +32 -0
- package/dist/commands/prompt-to-create-project/resolve-project-region.d.ts +8 -0
- package/dist/commands/prompt-to-create-project/resolve-project-region.js +27 -0
- package/dist/commands/prompt-to-create-project/resolve-project-subdomain.d.ts +9 -0
- package/dist/commands/prompt-to-create-project/resolve-project-subdomain.js +54 -0
- package/dist/commands/prompt-to-create-project/resolve-text-input.d.ts +9 -0
- package/dist/commands/prompt-to-create-project/resolve-text-input.js +23 -0
- package/dist/commands/prompt-to-create-project/resolve-workspace-plan-key.d.ts +12 -0
- package/dist/commands/prompt-to-create-project/resolve-workspace-plan-key.js +36 -0
- package/dist/commands/prompt-to-create-project/validate-subdomain.d.ts +1 -0
- package/dist/commands/prompt-to-create-project/validate-subdomain.js +9 -0
- package/dist/commands/prompt-to-create-project.d.ts +24 -0
- package/dist/commands/prompt-to-create-project.js +69 -0
- package/dist/commands/setup-agent.d.ts +12 -0
- package/dist/commands/setup-agent.js +123 -0
- package/dist/commands/upgrade.js +65 -1
- package/dist/commands/upload-schema.js +3 -4
- package/dist/commands/write-project-configuration.d.ts +12 -0
- package/dist/commands/write-project-configuration.js +16 -0
- package/dist/config/oauth.js +6 -1
- package/dist/constants.d.ts +0 -2
- package/dist/constants.js +0 -3
- package/dist/db-content-api/generated/content-api-types.d.ts +6 -2
- package/dist/db-content-api/index.d.ts +1 -1
- package/dist/db-content-api/index.js +121 -72
- package/dist/db-content-api/utilities/data/index.js +8 -2
- package/dist/db-content-api/utilities/data/injectGlobalType.d.ts +6 -0
- package/dist/db-content-api/utilities/data/injectGlobalType.js +11 -0
- package/dist/db-content-api/utilities/data/removeVirtualFields.d.ts +3 -11
- package/dist/db-content-api/utilities/data/removeVirtualFields.js +12 -50
- package/dist/db-content-api/utilities/isRecord.d.ts +9 -0
- package/dist/db-content-api/utilities/isRecord.js +19 -0
- package/dist/db-content-api/utilities/joins.js +5 -1
- package/dist/db-content-api/utilities/meta/resolvesToRelationshipValue.d.ts +10 -0
- package/dist/db-content-api/utilities/meta/resolvesToRelationshipValue.js +95 -0
- package/dist/db-content-api/utilities/meta/stringifyIdsInWhere.d.ts +9 -0
- package/dist/db-content-api/utilities/meta/stringifyIdsInWhere.js +112 -0
- package/dist/db-content-api/utilities/schema/buildDocumentSchema.js +9 -4
- package/dist/db-content-api/utilities/schema/getDocumentSchema.d.ts +3 -0
- package/dist/db-content-api/utilities/schema/getDocumentSchema.js +24 -0
- package/dist/db-content-api/utilities/where.d.ts +2 -6
- package/dist/db-content-api/utilities/where.js +20 -9
- package/dist/exports/client.d.ts +2 -0
- package/dist/exports/client.js +2 -0
- package/dist/exports/views.d.ts +1 -0
- package/dist/exports/views.js +1 -0
- package/dist/imageSizeOptions.d.ts +23 -0
- package/dist/imageSizeOptions.js +26 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/lib/write-agent-config.d.ts +12 -0
- package/dist/lib/write-agent-config.js +52 -0
- package/dist/next/image-loader.d.ts +6 -0
- package/dist/next/image-loader.js +14 -0
- package/dist/oauth/components/LoginButton/index.js +66 -19
- package/dist/oauth/components/LoginButton/index.scss +121 -15
- package/dist/oauth/defaults.js +4 -1
- package/dist/oauth/endpoints/getLoginEndpoint.js +5 -2
- package/dist/oauth/index.js +8 -7
- package/dist/oauth/utilities/getAdminCollectionSlug.d.ts +1 -1
- package/dist/oauth/utilities/getAuthorizeURL.d.ts +1 -0
- package/dist/oauth/utilities/getAuthorizeURL.js +5 -1
- package/dist/plugin/build-config.d.ts +13 -3
- package/dist/plugin/build-config.js +250 -49
- package/dist/plugin/cache-revalidation-hooks.d.ts +6 -0
- package/dist/plugin/cache-revalidation-hooks.js +69 -0
- package/dist/plugin/cloud-limits/CloudLimitModal/index.d.ts +9 -0
- package/dist/plugin/cloud-limits/CloudLimitModal/index.js +66 -0
- package/dist/plugin/cloud-limits/CloudLimitModal/index.scss +56 -0
- package/dist/plugin/cloud-limits/CloudLimitProvider/index.d.ts +4 -0
- package/dist/plugin/cloud-limits/CloudLimitProvider/index.js +110 -0
- package/dist/plugin/cloud-limits/LimitReachedView/index.css +14 -0
- package/dist/plugin/cloud-limits/LimitReachedView/index.d.ts +4 -0
- package/dist/plugin/cloud-limits/LimitReachedView/index.js +52 -0
- package/dist/plugin/cloud-limits/SlugRegistryContext/index.d.ts +7 -0
- package/dist/plugin/cloud-limits/SlugRegistryContext/index.js +3 -0
- package/dist/plugin/cloud-limits/SlugTracker/index.d.ts +1 -0
- package/dist/plugin/cloud-limits/SlugTracker/index.js +27 -0
- package/dist/plugin/cloud-limits/icons/ExternalLinkIcon.d.ts +3 -0
- package/dist/plugin/cloud-limits/icons/ExternalLinkIcon.js +30 -0
- package/dist/plugin/cloud-limits/routes.d.ts +2 -0
- package/dist/plugin/cloud-limits/routes.js +4 -0
- package/dist/plugin/cloud-limits/server/redirectInitialAutosaveCreate.d.ts +9 -0
- package/dist/plugin/cloud-limits/server/redirectInitialAutosaveCreate.js +28 -0
- package/dist/plugin/cloud-limits/shared.d.ts +10 -0
- package/dist/plugin/cloud-limits/shared.js +52 -0
- package/dist/plugin/cloud-limits/utilities/cloudLimitInterceptor.d.ts +2 -0
- package/dist/plugin/cloud-limits/utilities/cloudLimitInterceptor.js +134 -0
- package/dist/plugin/cloud-limits/utilities/toasts.d.ts +4 -0
- package/dist/plugin/cloud-limits/utilities/toasts.js +19 -0
- package/dist/plugin/make-permission-access/make-permission-access.d.ts +8 -0
- package/dist/plugin/make-permission-access/make-permission-access.js +24 -0
- package/dist/plugin/sandbox-upload-fetch.d.ts +22 -20
- package/dist/plugin/sandbox-upload-fetch.js +15 -21
- package/dist/skills/deploy-to-figma/SKILL.md +234 -0
- package/dist/skills/deploy-to-figma/references/cli-reference.md +146 -0
- package/dist/storage-content-api/api-types.d.ts +5 -2
- package/dist/storage-content-api/buildBaseMediaResponseHeaders.d.ts +1 -0
- package/dist/storage-content-api/buildBaseMediaResponseHeaders.js +8 -0
- package/dist/storage-content-api/buildClientUploadFetchBackHeaders.d.ts +12 -0
- package/dist/storage-content-api/buildClientUploadFetchBackHeaders.js +26 -0
- package/dist/storage-content-api/buildMediaRequestHeaders.d.ts +1 -0
- package/dist/storage-content-api/buildMediaRequestHeaders.js +14 -0
- package/dist/storage-content-api/buildMediaResponseHeaders.d.ts +4 -0
- package/dist/storage-content-api/buildMediaResponseHeaders.js +52 -0
- package/dist/storage-content-api/client-uploads/generate.d.ts +7 -3
- package/dist/storage-content-api/client-uploads/generate.js +22 -21
- package/dist/storage-content-api/copyFile.d.ts +16 -0
- package/dist/storage-content-api/copyFile.js +90 -0
- package/dist/storage-content-api/deleteFile.d.ts +8 -0
- package/dist/storage-content-api/deleteFile.js +18 -0
- package/dist/storage-content-api/getDownloadResponseHeaderPolicy.d.ts +11 -0
- package/dist/storage-content-api/getDownloadResponseHeaderPolicy.js +33 -0
- package/dist/storage-content-api/getMediaType.d.ts +1 -0
- package/dist/storage-content-api/getMediaType.js +3 -0
- package/dist/storage-content-api/handleUpload.d.ts +1 -2
- package/dist/storage-content-api/handleUpload.js +13 -157
- package/dist/storage-content-api/hasSupportedContentEncoding.d.ts +1 -0
- package/dist/storage-content-api/hasSupportedContentEncoding.js +6 -0
- package/dist/storage-content-api/index.js +17 -8
- package/dist/storage-content-api/mediaErrorResponse.d.ts +1 -0
- package/dist/storage-content-api/mediaErrorResponse.js +12 -0
- package/dist/storage-content-api/resolveDownloadResponseHeaders.d.ts +5 -0
- package/dist/storage-content-api/resolveDownloadResponseHeaders.js +13 -0
- package/dist/storage-content-api/shouldAttachMedia.d.ts +1 -0
- package/dist/storage-content-api/shouldAttachMedia.js +34 -0
- package/dist/storage-content-api/staticHandler.d.ts +2 -1
- package/dist/storage-content-api/staticHandler.js +87 -32
- package/dist/storage-content-api/types.d.ts +4 -1
- package/dist/storage-content-api/uploadFileData.d.ts +10 -0
- package/dist/storage-content-api/uploadFileData.js +145 -0
- package/dist/translations/ar.d.ts +12 -0
- package/dist/translations/ar.js +12 -0
- package/dist/translations/az.d.ts +12 -0
- package/dist/translations/az.js +12 -0
- package/dist/translations/bg.d.ts +12 -0
- package/dist/translations/bg.js +12 -0
- package/dist/translations/bnBd.d.ts +12 -0
- package/dist/translations/bnBd.js +12 -0
- package/dist/translations/bnIn.d.ts +12 -0
- package/dist/translations/bnIn.js +12 -0
- package/dist/translations/ca.d.ts +12 -0
- package/dist/translations/ca.js +12 -0
- package/dist/translations/cs.d.ts +12 -0
- package/dist/translations/cs.js +12 -0
- package/dist/translations/da.d.ts +12 -0
- package/dist/translations/da.js +12 -0
- package/dist/translations/de.d.ts +12 -0
- package/dist/translations/de.js +12 -0
- package/dist/translations/en.d.ts +12 -0
- package/dist/translations/en.js +12 -0
- package/dist/translations/es.d.ts +12 -0
- package/dist/translations/es.js +12 -0
- package/dist/translations/et.d.ts +12 -0
- package/dist/translations/et.js +12 -0
- package/dist/translations/fa.d.ts +12 -0
- package/dist/translations/fa.js +12 -0
- package/dist/translations/fr.d.ts +12 -0
- package/dist/translations/fr.js +12 -0
- package/dist/translations/he.d.ts +12 -0
- package/dist/translations/he.js +12 -0
- package/dist/translations/hr.d.ts +12 -0
- package/dist/translations/hr.js +12 -0
- package/dist/translations/hu.d.ts +12 -0
- package/dist/translations/hu.js +12 -0
- package/dist/translations/hy.d.ts +12 -0
- package/dist/translations/hy.js +12 -0
- package/dist/translations/id.d.ts +12 -0
- package/dist/translations/id.js +12 -0
- package/dist/translations/index.d.ts +533 -0
- package/dist/translations/index.js +90 -0
- package/dist/translations/is.d.ts +12 -0
- package/dist/translations/is.js +12 -0
- package/dist/translations/it.d.ts +12 -0
- package/dist/translations/it.js +12 -0
- package/dist/translations/ja.d.ts +12 -0
- package/dist/translations/ja.js +12 -0
- package/dist/translations/ko.d.ts +12 -0
- package/dist/translations/ko.js +12 -0
- package/dist/translations/lt.d.ts +12 -0
- package/dist/translations/lt.js +12 -0
- package/dist/translations/lv.d.ts +12 -0
- package/dist/translations/lv.js +12 -0
- package/dist/translations/my.d.ts +12 -0
- package/dist/translations/my.js +12 -0
- package/dist/translations/nb.d.ts +12 -0
- package/dist/translations/nb.js +12 -0
- package/dist/translations/nl.d.ts +12 -0
- package/dist/translations/nl.js +12 -0
- package/dist/translations/pl.d.ts +12 -0
- package/dist/translations/pl.js +12 -0
- package/dist/translations/pt.d.ts +12 -0
- package/dist/translations/pt.js +12 -0
- package/dist/translations/ro.d.ts +12 -0
- package/dist/translations/ro.js +12 -0
- package/dist/translations/rs.d.ts +12 -0
- package/dist/translations/rs.js +12 -0
- package/dist/translations/rsLatin.d.ts +12 -0
- package/dist/translations/rsLatin.js +12 -0
- package/dist/translations/ru.d.ts +12 -0
- package/dist/translations/ru.js +12 -0
- package/dist/translations/sk.d.ts +12 -0
- package/dist/translations/sk.js +12 -0
- package/dist/translations/sl.d.ts +12 -0
- package/dist/translations/sl.js +12 -0
- package/dist/translations/sv.d.ts +12 -0
- package/dist/translations/sv.js +12 -0
- package/dist/translations/ta.d.ts +12 -0
- package/dist/translations/ta.js +12 -0
- package/dist/translations/th.d.ts +12 -0
- package/dist/translations/th.js +12 -0
- package/dist/translations/tr.d.ts +12 -0
- package/dist/translations/tr.js +12 -0
- package/dist/translations/uk.d.ts +12 -0
- package/dist/translations/uk.js +12 -0
- package/dist/translations/vi.d.ts +12 -0
- package/dist/translations/vi.js +12 -0
- package/dist/translations/zh.d.ts +12 -0
- package/dist/translations/zh.js +12 -0
- package/dist/translations/zhTw.d.ts +12 -0
- package/dist/translations/zhTw.js +12 -0
- package/dist/types.d.ts +11 -0
- package/dist/utils/assert-never.d.ts +1 -0
- package/dist/utils/assert-never.js +3 -0
- package/dist/utils/build-detection.d.ts +6 -1
- package/dist/utils/build-detection.js +68 -89
- package/dist/utils/cache-bootstrap.js +1 -0
- package/dist/utils/deploy-adapter.d.ts +3 -35
- package/dist/utils/deploy-adapter.js +25 -14
- package/dist/utils/env-management.d.ts +15 -0
- package/dist/utils/env-management.js +47 -0
- package/dist/utils/lambda-config.js +18 -23
- package/dist/utils/load-payload-config.js +1 -6
- package/dist/utils/messages.js +24 -3
- package/dist/utils/next-image-loader-config.d.ts +2 -0
- package/dist/utils/next-image-loader-config.js +63 -0
- package/dist/utils/next-image-loader-file.d.ts +2 -0
- package/dist/utils/next-image-loader-file.js +11 -0
- package/dist/utils/payload-config-ast.d.ts +5 -0
- package/dist/utils/payload-config-ast.js +73 -4
- package/dist/utils/payload-config-modifier.js +3 -0
- package/dist/utils/payload-generate.d.ts +10 -0
- package/dist/utils/payload-generate.js +59 -0
- package/dist/utils/payload-secret.d.ts +28 -0
- package/dist/utils/payload-secret.js +34 -0
- package/dist/utils/pnpm-builds.d.ts +14 -0
- package/dist/utils/pnpm-builds.js +125 -0
- package/dist/utils/s3-upload.js +4 -1
- package/package.json +32 -7
- package/dist/lib/download-skill.d.ts +0 -12
- package/dist/lib/download-skill.js +0 -77
- package/dist/storage-content-api/handleDelete.d.ts +0 -7
- package/dist/storage-content-api/handleDelete.js +0 -15
- package/dist/storage-content-api/utilities/getSafeFilename.d.ts +0 -11
- package/dist/storage-content-api/utilities/getSafeFilename.js +0 -59
- package/dist/storage-content-api/utilities/index.d.ts +0 -2
- package/dist/storage-content-api/utilities/index.js +0 -2
- package/dist/storage-content-api/utilities/parseUploadReference.d.ts +0 -17
- package/dist/storage-content-api/utilities/parseUploadReference.js +0 -27
- package/dist/utils/adapters/nextjs.d.ts +0 -8
- package/dist/utils/adapters/nextjs.js +0 -61
- package/dist/utils/adapters/nitro.d.ts +0 -8
- package/dist/utils/adapters/nitro.js +0 -172
- package/dist/utils/adapters/vite.js +0 -31
- package/dist/utils/asset-collection.js +0 -144
- package/dist/utils/build-lambda-zip.js +0 -90
- package/dist/utils/fs-utils.d.ts +0 -12
- package/dist/utils/fs-utils.js +0 -55
package/dist/types.d.ts
CHANGED
|
@@ -1,17 +1,28 @@
|
|
|
1
1
|
import type arg from 'arg';
|
|
2
2
|
export interface Args extends arg.Spec {
|
|
3
|
+
'--adapter': StringConstructor;
|
|
4
|
+
'--callback-url': StringConstructor;
|
|
5
|
+
'--complete': StringConstructor;
|
|
3
6
|
'--debug': BooleanConstructor;
|
|
7
|
+
'--description': StringConstructor;
|
|
4
8
|
'--dry-run': BooleanConstructor;
|
|
5
9
|
'--env': StringConstructor;
|
|
6
10
|
'--environment': string;
|
|
7
11
|
'--force': BooleanConstructor;
|
|
12
|
+
'--global': BooleanConstructor;
|
|
13
|
+
'--headless': BooleanConstructor;
|
|
8
14
|
'--help': BooleanConstructor;
|
|
9
15
|
'--id': StringConstructor;
|
|
10
16
|
'--infra-env': StringConstructor;
|
|
11
17
|
'--list': BooleanConstructor;
|
|
12
18
|
'--logout': BooleanConstructor;
|
|
13
19
|
'--name': StringConstructor;
|
|
20
|
+
'--output': StringConstructor;
|
|
21
|
+
'--project': BooleanConstructor;
|
|
22
|
+
'--region': StringConstructor;
|
|
23
|
+
'--subdomain': StringConstructor;
|
|
14
24
|
'--template': StringConstructor;
|
|
25
|
+
'--workspace': StringConstructor;
|
|
15
26
|
'--yes': BooleanConstructor;
|
|
16
27
|
'-e': string;
|
|
17
28
|
'-f': string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function assertNever(x: never): never;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AdapterName } from './deploy-adapter.js';
|
|
1
2
|
/**
|
|
2
3
|
* Information about a detected build
|
|
3
4
|
*/
|
|
@@ -11,11 +12,15 @@ export interface BuildInfo {
|
|
|
11
12
|
/** Build timestamp */
|
|
12
13
|
timestamp: Date;
|
|
13
14
|
}
|
|
15
|
+
export interface DetectBuildOptions {
|
|
16
|
+
adapter?: AdapterName;
|
|
17
|
+
output?: string;
|
|
18
|
+
}
|
|
14
19
|
/**
|
|
15
20
|
* Detect a valid build across supported frameworks.
|
|
16
21
|
* Tries NextJS, then Nitro, then Vite. Returns the first match.
|
|
17
22
|
*/
|
|
18
|
-
export declare function detectBuild(projectPath: string): Promise<BuildInfo | null>;
|
|
23
|
+
export declare function detectBuild(projectPath: string, options: DetectBuildOptions): Promise<BuildInfo | null>;
|
|
19
24
|
/**
|
|
20
25
|
* Get the build command from package.json
|
|
21
26
|
*
|
|
@@ -1,103 +1,82 @@
|
|
|
1
1
|
import fs from 'fs/promises';
|
|
2
2
|
import path from 'path';
|
|
3
|
+
import { inspectNextjsOutput } from '../adapters/deploy-output/inspectNextjsOutput.js';
|
|
4
|
+
import { inspectNitroOutput } from '../adapters/deploy-output/inspectNitroOutput.js';
|
|
5
|
+
import { resolveOutputPath } from '../adapters/deploy-output/resolveOutputPath.js';
|
|
6
|
+
import { assertNever } from './assert-never.js';
|
|
3
7
|
/**
|
|
4
8
|
* Detect a valid build across supported frameworks.
|
|
5
9
|
* Tries NextJS, then Nitro, then Vite. Returns the first match.
|
|
6
|
-
*/ export async function detectBuild(projectPath) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
if (viteBuild) {
|
|
20
|
-
return viteBuild;
|
|
21
|
-
}
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Detect NextJS standalone build (.next/standalone/server.js + .next/BUILD_ID)
|
|
26
|
-
*/ async function detectNextjsBuild(projectPath) {
|
|
27
|
-
try {
|
|
28
|
-
const serverPath = path.join(projectPath, '.next', 'standalone', 'server.js');
|
|
29
|
-
const serverStat = await fs.stat(serverPath);
|
|
30
|
-
const buildIdPath = path.join(projectPath, '.next', 'BUILD_ID');
|
|
31
|
-
const buildId = (await fs.readFile(buildIdPath, 'utf-8')).trim();
|
|
32
|
-
const lambdaZipPath = path.join(projectPath, 'lambda.zip');
|
|
33
|
-
let hasLambdaZip = false;
|
|
34
|
-
try {
|
|
35
|
-
await fs.stat(lambdaZipPath);
|
|
36
|
-
hasLambdaZip = true;
|
|
37
|
-
} catch {
|
|
38
|
-
hasLambdaZip = false;
|
|
10
|
+
*/ export async function detectBuild(projectPath, options) {
|
|
11
|
+
const adapters = options.adapter ? [
|
|
12
|
+
options.adapter
|
|
13
|
+
] : [
|
|
14
|
+
'nextjs',
|
|
15
|
+
'nitro',
|
|
16
|
+
'vite'
|
|
17
|
+
];
|
|
18
|
+
for (const adapter of adapters){
|
|
19
|
+
const outputPath = resolveOutputPath(projectPath, adapter, options.output);
|
|
20
|
+
const build = await detectAdapterBuild(projectPath, adapter, outputPath);
|
|
21
|
+
if (build) {
|
|
22
|
+
return build;
|
|
39
23
|
}
|
|
40
|
-
return {
|
|
41
|
-
buildId,
|
|
42
|
-
hasLambdaZip,
|
|
43
|
-
path: '.next/standalone',
|
|
44
|
-
timestamp: serverStat.mtime
|
|
45
|
-
};
|
|
46
|
-
} catch {
|
|
47
|
-
return null;
|
|
48
24
|
}
|
|
25
|
+
return null;
|
|
49
26
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
27
|
+
async function detectAdapterBuild(projectPath, adapter, outputPath) {
|
|
28
|
+
switch(adapter){
|
|
29
|
+
case 'nextjs':
|
|
30
|
+
{
|
|
31
|
+
const layout = await inspectNextjsOutput(outputPath);
|
|
32
|
+
if (!layout) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
const stat = await fs.stat(layout.serverEntryPath);
|
|
36
|
+
return {
|
|
37
|
+
buildId: layout.buildId,
|
|
38
|
+
hasLambdaZip: await hasLambdaZip(projectPath),
|
|
39
|
+
path: path.relative(projectPath, layout.standalonePath),
|
|
40
|
+
timestamp: stat.mtime
|
|
41
|
+
};
|
|
63
42
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
43
|
+
case 'nitro':
|
|
44
|
+
{
|
|
45
|
+
const layout = await inspectNitroOutput(outputPath);
|
|
46
|
+
if (!layout) {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
const stat = await fs.stat(layout.serverEntryPath);
|
|
50
|
+
return {
|
|
51
|
+
buildId: layout.buildId ?? stat.mtime.toISOString(),
|
|
52
|
+
hasLambdaZip: await hasLambdaZip(projectPath),
|
|
53
|
+
path: path.relative(projectPath, outputPath),
|
|
54
|
+
timestamp: stat.mtime
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
case 'vite':
|
|
58
|
+
{
|
|
59
|
+
try {
|
|
60
|
+
const stat = await fs.stat(path.join(outputPath, 'index.html'));
|
|
61
|
+
if (!stat.isFile()) {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
buildId: stat.mtime.toISOString(),
|
|
66
|
+
hasLambdaZip: false,
|
|
67
|
+
path: path.relative(projectPath, outputPath),
|
|
68
|
+
timestamp: stat.mtime
|
|
69
|
+
};
|
|
70
|
+
} catch {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
default:
|
|
75
|
+
assertNever(adapter);
|
|
83
76
|
}
|
|
84
77
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
* Build ID is mtime of index.html as ISO string. No server, so hasLambdaZip is always false.
|
|
88
|
-
*/ async function detectViteBuild(projectPath) {
|
|
89
|
-
try {
|
|
90
|
-
const indexPath = path.join(projectPath, 'dist', 'index.html');
|
|
91
|
-
const indexStat = await fs.stat(indexPath);
|
|
92
|
-
return {
|
|
93
|
-
buildId: indexStat.mtime.toISOString(),
|
|
94
|
-
hasLambdaZip: false,
|
|
95
|
-
path: 'dist',
|
|
96
|
-
timestamp: indexStat.mtime
|
|
97
|
-
};
|
|
98
|
-
} catch {
|
|
99
|
-
return null;
|
|
100
|
-
}
|
|
78
|
+
async function hasLambdaZip(projectPath) {
|
|
79
|
+
return fs.stat(path.join(projectPath, 'lambda.zip')).then(()=>true).catch(()=>false);
|
|
101
80
|
}
|
|
102
81
|
/**
|
|
103
82
|
* Get the build command from package.json
|
|
@@ -6,6 +6,7 @@ import * as log from './log.js';
|
|
|
6
6
|
const { oauthCredentials } = bootstrapInfo;
|
|
7
7
|
for (const env of bootstrapInfo.environments){
|
|
8
8
|
tokenStore.setBootstrapData(projectId, env.name, {
|
|
9
|
+
contentApiUrl: env.contentApiUrl,
|
|
9
10
|
contentSystemId: env.contentSystemId,
|
|
10
11
|
oauthClientId: oauthCredentials.oauthClientId,
|
|
11
12
|
oauthClientSecret: oauthCredentials.oauthClientSecret,
|
|
@@ -1,37 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
pathMap: Record<string, string>;
|
|
4
|
-
/** Route → S3 upload keys for that route (e.g., { "/products": ["products.html", "products.rsc"] }) */
|
|
5
|
-
routeAssetMap: Record<string, string[]>;
|
|
6
|
-
/** Route paths for the manifest pages array (e.g., ["/products", "/blog"]) */
|
|
7
|
-
routes: string[];
|
|
8
|
-
/** S3 keys to upload (e.g., ["products.html", "products.rsc", "products.meta"]) */
|
|
9
|
-
uploadKeys: string[];
|
|
10
|
-
}
|
|
11
|
-
export interface AssetCollection {
|
|
12
|
-
/** S3 key → relative filesystem path from project root */
|
|
13
|
-
pathMap: Record<string, string>;
|
|
14
|
-
/** Route paths for the manifest assets array (e.g., ["/favicon.ico"]) */
|
|
15
|
-
routes: string[];
|
|
16
|
-
/** S3 keys to upload (same as routes for assets, without leading slash) */
|
|
17
|
-
uploadKeys: string[];
|
|
18
|
-
}
|
|
19
|
-
export type AdapterName = 'nextjs' | 'nitro' | 'vite';
|
|
20
|
-
export interface LambdaBundle {
|
|
21
|
-
/** Total size in bytes of the bundle contents before compression. */
|
|
22
|
-
unzippedBytes: number;
|
|
23
|
-
/** Absolute path to the built lambda.zip. */
|
|
24
|
-
zipPath: string;
|
|
25
|
-
}
|
|
26
|
-
export interface DeployAdapter {
|
|
27
|
-
collectAssets(projectPath: string): Promise<AssetCollection>;
|
|
28
|
-
collectPages(projectPath: string): Promise<PageCollection>;
|
|
29
|
-
/** SPA fallback path (e.g., "/index.html"). Undefined for SSR/SSG apps. */
|
|
30
|
-
fallback?: string;
|
|
31
|
-
name: AdapterName;
|
|
32
|
-
/** Assembles and zips the server bundle. Returns the bundle, or null if no server (e.g., Vite SPA). */
|
|
33
|
-
prepareLambdaBundle(projectPath: string): Promise<LambdaBundle | null>;
|
|
34
|
-
}
|
|
1
|
+
import type { AdapterName, DeployAdapter } from '../adapters/types.js';
|
|
2
|
+
export type { AdapterLogger, AdapterName, AssetCollection, DeployAdapter, LambdaBundle, PageCollection, PrepareLambdaBundleOptions, } from '../adapters/types.js';
|
|
35
3
|
/**
|
|
36
4
|
* Auto-detect the framework adapter based on build output.
|
|
37
5
|
*
|
|
@@ -42,4 +10,4 @@ export interface DeployAdapter {
|
|
|
42
10
|
* @param projectPath - Path to project root
|
|
43
11
|
* @param override - Explicit adapter name from --adapter flag
|
|
44
12
|
*/
|
|
45
|
-
export declare function detectAdapter(projectPath: string, override?: AdapterName): Promise<DeployAdapter>;
|
|
13
|
+
export declare function detectAdapter(projectPath: string, override?: AdapterName, output?: string): Promise<DeployAdapter>;
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import fs from 'fs/promises';
|
|
2
2
|
import path from 'path';
|
|
3
|
+
import { inspectNextjsOutput } from '../adapters/deploy-output/inspectNextjsOutput.js';
|
|
4
|
+
import { inspectNitroOutput } from '../adapters/deploy-output/inspectNitroOutput.js';
|
|
5
|
+
import { resolveOutputPath } from '../adapters/deploy-output/resolveOutputPath.js';
|
|
6
|
+
import * as log from './log.js';
|
|
7
|
+
const adapterLogger = {
|
|
8
|
+
info: log.info,
|
|
9
|
+
warning: log.warning
|
|
10
|
+
};
|
|
3
11
|
/**
|
|
4
12
|
* Auto-detect the framework adapter based on build output.
|
|
5
13
|
*
|
|
@@ -9,40 +17,43 @@ import path from 'path';
|
|
|
9
17
|
*
|
|
10
18
|
* @param projectPath - Path to project root
|
|
11
19
|
* @param override - Explicit adapter name from --adapter flag
|
|
12
|
-
*/ export async function detectAdapter(projectPath, override) {
|
|
20
|
+
*/ export async function detectAdapter(projectPath, override, output) {
|
|
13
21
|
if (override) {
|
|
14
22
|
return loadAdapter(override);
|
|
15
23
|
}
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
const hasViteDist = await exists(path.join(projectPath, 'dist', 'index.html'));
|
|
19
|
-
if (hasNext) {
|
|
24
|
+
const nextOutput = resolveOutputPath(projectPath, 'nextjs', output);
|
|
25
|
+
if (await inspectNextjsOutput(nextOutput)) {
|
|
20
26
|
return loadAdapter('nextjs');
|
|
21
27
|
}
|
|
22
|
-
|
|
28
|
+
const nitroOutput = resolveOutputPath(projectPath, 'nitro', output);
|
|
29
|
+
if (await inspectNitroOutput(nitroOutput)) {
|
|
23
30
|
return loadAdapter('nitro');
|
|
24
31
|
}
|
|
25
|
-
|
|
32
|
+
const viteOutput = resolveOutputPath(projectPath, 'vite', output);
|
|
33
|
+
if (await exists(path.join(viteOutput, 'index.html'))) {
|
|
26
34
|
return loadAdapter('vite');
|
|
27
35
|
}
|
|
28
|
-
|
|
36
|
+
const location = output ? ` in ${path.resolve(projectPath, output)}` : '';
|
|
37
|
+
throw new Error(`Could not detect framework${location}. Expected Next.js BUILD_ID + standalone server, ` + 'Nitro server entry, or Vite index.html. ' + 'Use --adapter to specify explicitly.');
|
|
29
38
|
}
|
|
30
39
|
async function loadAdapter(name) {
|
|
31
40
|
switch(name){
|
|
32
41
|
case 'nextjs':
|
|
33
42
|
{
|
|
34
|
-
const mod = await import('
|
|
35
|
-
return mod.
|
|
43
|
+
const mod = await import('../adapters/nextjs.js');
|
|
44
|
+
return new mod.NextjsAdapter({
|
|
45
|
+
logger: adapterLogger
|
|
46
|
+
});
|
|
36
47
|
}
|
|
37
48
|
case 'nitro':
|
|
38
49
|
{
|
|
39
|
-
const mod = await import('
|
|
40
|
-
return mod.
|
|
50
|
+
const mod = await import('../adapters/nitro.js');
|
|
51
|
+
return new mod.NitroAdapter();
|
|
41
52
|
}
|
|
42
53
|
case 'vite':
|
|
43
54
|
{
|
|
44
|
-
const mod = await import('
|
|
45
|
-
return mod.
|
|
55
|
+
const mod = await import('../adapters/vite.js');
|
|
56
|
+
return new mod.ViteAdapter();
|
|
46
57
|
}
|
|
47
58
|
}
|
|
48
59
|
}
|
|
@@ -14,6 +14,8 @@ export declare function getEnvVar(projectPath: string, key: string): Promise<nul
|
|
|
14
14
|
* @returns The value if found, null otherwise
|
|
15
15
|
*/
|
|
16
16
|
export declare function getEnvVarSync(projectPath: string, key: string): null | string;
|
|
17
|
+
/** Read a dotenv-parsed value without populating process.env. */
|
|
18
|
+
export declare function getParsedEnvVarSync(projectPath: string, key: string): null | string;
|
|
17
19
|
/**
|
|
18
20
|
* Add or update an environment variable in .env file
|
|
19
21
|
*
|
|
@@ -22,6 +24,19 @@ export declare function getEnvVarSync(projectPath: string, key: string): null |
|
|
|
22
24
|
* @param value - Environment variable value
|
|
23
25
|
*/
|
|
24
26
|
export declare function addOrUpdateEnvVar(projectPath: string, key: string, value: string): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Comment out an environment variable in .env file by prepending `# ` to any
|
|
29
|
+
* assignment line for the given key. Preserves the value so the developer can
|
|
30
|
+
* uncomment it later (or move it to another env file). No-op if the key is
|
|
31
|
+
* absent or every occurrence is already commented.
|
|
32
|
+
*
|
|
33
|
+
* @param projectPath - Path to project directory
|
|
34
|
+
* @param key - Environment variable name to disable
|
|
35
|
+
* @param annotation - Optional trailing comment appended to each disabled
|
|
36
|
+
* line, so the developer knows why it was disabled
|
|
37
|
+
* @returns true if at least one line was commented out, false otherwise
|
|
38
|
+
*/
|
|
39
|
+
export declare function commentOutEnvVar(projectPath: string, key: string, annotation?: string): Promise<boolean>;
|
|
25
40
|
/**
|
|
26
41
|
* Remove an environment variable from .env file
|
|
27
42
|
*
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { parse } from 'dotenv';
|
|
1
2
|
import fs from 'fs/promises';
|
|
2
3
|
import fsSync from 'node:fs';
|
|
3
4
|
import path from 'path';
|
|
@@ -54,6 +55,14 @@ import path from 'path';
|
|
|
54
55
|
return null;
|
|
55
56
|
}
|
|
56
57
|
}
|
|
58
|
+
/** Read a dotenv-parsed value without populating process.env. */ export function getParsedEnvVarSync(projectPath, key) {
|
|
59
|
+
try {
|
|
60
|
+
const contents = fsSync.readFileSync(path.join(projectPath, '.env'), 'utf-8');
|
|
61
|
+
return parse(contents)[key] ?? null;
|
|
62
|
+
} catch {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
57
66
|
/**
|
|
58
67
|
* Add or update an environment variable in .env file
|
|
59
68
|
*
|
|
@@ -115,6 +124,44 @@ import path from 'path';
|
|
|
115
124
|
throw new Error(`Failed to update .env file: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
116
125
|
}
|
|
117
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* Comment out an environment variable in .env file by prepending `# ` to any
|
|
129
|
+
* assignment line for the given key. Preserves the value so the developer can
|
|
130
|
+
* uncomment it later (or move it to another env file). No-op if the key is
|
|
131
|
+
* absent or every occurrence is already commented.
|
|
132
|
+
*
|
|
133
|
+
* @param projectPath - Path to project directory
|
|
134
|
+
* @param key - Environment variable name to disable
|
|
135
|
+
* @param annotation - Optional trailing comment appended to each disabled
|
|
136
|
+
* line, so the developer knows why it was disabled
|
|
137
|
+
* @returns true if at least one line was commented out, false otherwise
|
|
138
|
+
*/ export async function commentOutEnvVar(projectPath, key, annotation) {
|
|
139
|
+
const envPath = path.join(projectPath, '.env');
|
|
140
|
+
try {
|
|
141
|
+
const contents = await fs.readFile(envPath, 'utf-8');
|
|
142
|
+
const lines = contents.split(/\r?\n/);
|
|
143
|
+
let changed = false;
|
|
144
|
+
const updated = lines.map((line)=>{
|
|
145
|
+
if (!line.includes('=') || line.trim().startsWith('#')) {
|
|
146
|
+
return line;
|
|
147
|
+
}
|
|
148
|
+
const equalsIndex = line.indexOf('=');
|
|
149
|
+
const lineKey = line.substring(0, equalsIndex).trim();
|
|
150
|
+
if (lineKey !== key) {
|
|
151
|
+
return line;
|
|
152
|
+
}
|
|
153
|
+
changed = true;
|
|
154
|
+
const suffix = annotation ? ` # ${annotation}` : '';
|
|
155
|
+
return `# ${line}${suffix}`;
|
|
156
|
+
});
|
|
157
|
+
if (changed) {
|
|
158
|
+
await fs.writeFile(envPath, updated.join('\n'), 'utf-8');
|
|
159
|
+
}
|
|
160
|
+
return changed;
|
|
161
|
+
} catch {
|
|
162
|
+
return false;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
118
165
|
/**
|
|
119
166
|
* Remove an environment variable from .env file
|
|
120
167
|
*
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import fs from 'fs/promises';
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import { IndentationText, Node, Project, SyntaxKind } from 'ts-morph';
|
|
4
|
+
import { addFigmaImageLoaderConfig } from './next-image-loader-config.js';
|
|
5
|
+
import { writeFigmaImageLoaderFile } from './next-image-loader-file.js';
|
|
6
|
+
import { ensurePnpmWorkspace } from './pnpm-builds.js';
|
|
4
7
|
const RUN_SH_CONTENT = `#!/bin/bash -x
|
|
5
8
|
|
|
6
9
|
[ ! -d '/tmp/cache' ] && mkdir -p /tmp/cache
|
|
@@ -17,23 +20,13 @@ NODE_ENV=production exec node server.js
|
|
|
17
20
|
const runShPath = path.join(projectPath, 'run.sh');
|
|
18
21
|
await fs.writeFile(runShPath, RUN_SH_CONTENT, 'utf-8');
|
|
19
22
|
await fs.chmod(runShPath, 0o755);
|
|
20
|
-
// 2.
|
|
23
|
+
// 2. Add Next.js-specific configuration.
|
|
21
24
|
await addNextConfigProperties(projectPath);
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
let npmrcContent = '';
|
|
25
|
-
try {
|
|
26
|
-
npmrcContent = await fs.readFile(npmrcPath, 'utf-8');
|
|
27
|
-
} catch {
|
|
28
|
-
// File doesn't exist, start fresh
|
|
29
|
-
}
|
|
30
|
-
if (!npmrcContent.includes('node-linker=hoisted')) {
|
|
31
|
-
npmrcContent += npmrcContent && !npmrcContent.endsWith('\n') ? '\n' : '';
|
|
32
|
-
npmrcContent += 'node-linker=hoisted\n';
|
|
33
|
-
await fs.writeFile(npmrcPath, npmrcContent, 'utf-8');
|
|
34
|
-
}
|
|
35
|
-
// 4. Add lambda:buildzip script to package.json
|
|
25
|
+
await writeFigmaImageLoaderFile(projectPath);
|
|
26
|
+
// 3. Add lambda:buildzip script to package.json
|
|
36
27
|
await addLambdaBuildScript(projectPath, packageManager);
|
|
28
|
+
// 4. Write pnpm-workspace.yaml (hoisted linker + build approvals)
|
|
29
|
+
await ensurePnpmWorkspace(projectPath);
|
|
37
30
|
}
|
|
38
31
|
/**
|
|
39
32
|
* Find the Next.js config file, checking TS extensions first
|
|
@@ -58,6 +51,7 @@ NODE_ENV=production exec node server.js
|
|
|
58
51
|
/**
|
|
59
52
|
* Add required Next.js config properties using ts-morph AST parsing
|
|
60
53
|
* - output: 'standalone' (for Lambda deployment)
|
|
54
|
+
* - images.loader: 'custom' and images.loaderFile for Payload media
|
|
61
55
|
*/ async function addNextConfigProperties(projectPath) {
|
|
62
56
|
const nextConfigPath = await findNextConfigPath(projectPath);
|
|
63
57
|
const project = new Project({
|
|
@@ -75,15 +69,16 @@ NODE_ENV=production exec node server.js
|
|
|
75
69
|
if (!configObject) {
|
|
76
70
|
throw new Error(`Could not find Next.js config object in ${path.basename(nextConfigPath)}. ` + `Expected either 'export default { ... }' or 'export default wrapper(configVar, ...)'`);
|
|
77
71
|
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
72
|
+
if (configObject.getProperty('output') === undefined) {
|
|
73
|
+
configObject.addPropertyAssignment({
|
|
74
|
+
name: 'output',
|
|
75
|
+
initializer: "'standalone'"
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
addFigmaImageLoaderConfig(configObject);
|
|
79
|
+
if (!sourceFile.isSaved()) {
|
|
80
|
+
await sourceFile.save();
|
|
81
81
|
}
|
|
82
|
-
configObject.addPropertyAssignment({
|
|
83
|
-
name: 'output',
|
|
84
|
-
initializer: "'standalone'"
|
|
85
|
-
});
|
|
86
|
-
await sourceFile.save();
|
|
87
82
|
}
|
|
88
83
|
/**
|
|
89
84
|
* Find the config object literal from either:
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';
|
|
2
1
|
import path from 'node:path';
|
|
3
2
|
import { pathToFileURL } from 'node:url';
|
|
4
3
|
import { findPayloadConfig } from './payload-config-finder.js';
|
|
@@ -16,11 +15,7 @@ import { findPayloadConfig } from './payload-config-finder.js';
|
|
|
16
15
|
const absoluteConfigPath = path.resolve(projectPath, configPath);
|
|
17
16
|
const { loadEnv } = await import('payload/node');
|
|
18
17
|
loadEnv();
|
|
19
|
-
const
|
|
20
|
-
const payloadEntryPath = requireFromProject.resolve('payload');
|
|
21
|
-
const requireFromPayload = createRequire(payloadEntryPath);
|
|
22
|
-
const tsxApiPath = requireFromPayload.resolve('tsx/esm/api');
|
|
23
|
-
const { tsImport } = await import(pathToFileURL(tsxApiPath).href);
|
|
18
|
+
const tsImport = (await import('tsx/esm/api')).tsImport;
|
|
24
19
|
const parentURL = pathToFileURL(`${projectPath}${path.sep}`).href;
|
|
25
20
|
const imported = await tsImport(absoluteConfigPath, parentURL);
|
|
26
21
|
return await (imported.default ?? imported);
|
package/dist/utils/messages.js
CHANGED
|
@@ -14,6 +14,7 @@ export function helpMessage() {
|
|
|
14
14
|
${pc.cyan('logout')} Clear all stored tokens
|
|
15
15
|
${pc.cyan('list-tokens')} Show stored token information
|
|
16
16
|
${pc.cyan('init')} Initialize a Figma CMS project
|
|
17
|
+
${pc.cyan('setup-agent')} Install or update the Figma deploy skill
|
|
17
18
|
${pc.cyan('bootstrap')} Print bootstrap info (tenant IDs, OAuth creds) for a project
|
|
18
19
|
${pc.cyan('debug')} Show debug info for troubleshooting
|
|
19
20
|
${pc.cyan('env')} Switch active environment
|
|
@@ -31,16 +32,20 @@ export function helpMessage() {
|
|
|
31
32
|
${pc.bold('AUTHENTICATION')}
|
|
32
33
|
|
|
33
34
|
${pc.cyan('@payloadcms/figma login')} Authenticate with Figma
|
|
35
|
+
${pc.cyan('@payloadcms/figma login --headless --json')} Start resumable login for agents
|
|
36
|
+
${pc.cyan('@payloadcms/figma login --complete <id> --callback-url <url>')} Complete resumable login
|
|
37
|
+
${pc.dim('--json')} Emit machine-readable login status
|
|
34
38
|
${pc.cyan('@payloadcms/figma logout')} Clear tokens for current environment
|
|
35
39
|
${pc.cyan('@payloadcms/figma list-tokens')} Display stored OAuth and project tokens
|
|
36
40
|
|
|
37
41
|
${pc.bold('INIT COMMAND')}
|
|
38
42
|
|
|
39
|
-
${pc.cyan('@payloadcms/figma init
|
|
43
|
+
${pc.cyan('@payloadcms/figma init')} Create and initialize project
|
|
44
|
+
${pc.cyan('@payloadcms/figma init --id <cms-resource-id>')} Connect existing project
|
|
40
45
|
${pc.cyan('@payloadcms/figma init --id <id> --env staging')} Initialize for specific environment
|
|
41
46
|
${pc.dim('--name, -n <name>')} Set project directory name (skips prompt)
|
|
42
47
|
${pc.dim('--force')} Force reconfiguration of existing project
|
|
43
|
-
${pc.dim('--no-
|
|
48
|
+
${pc.dim('--no-agent')} Skip writing AI agent config files (AGENTS.md, CLAUDE.md)
|
|
44
49
|
${pc.dim('--template, -t <spec>')} Override scaffold template (e.g. main:website, owner/repo#ref:path)
|
|
45
50
|
${pc.dim('--payload-version <tag|version>')} Core Payload npm dist-tag or version (default canary; e.g. latest, 4.0.0-canary.16)
|
|
46
51
|
|
|
@@ -58,11 +63,27 @@ export function helpMessage() {
|
|
|
58
63
|
${pc.bold('DEPLOY COMMAND')}
|
|
59
64
|
|
|
60
65
|
${pc.cyan('@payloadcms/figma deploy')} Deploy your project to Figma
|
|
66
|
+
${pc.dim(' Creates a project when not initialized')}
|
|
61
67
|
${pc.dim('--id <project-id>')} Override FIGMA_PROJECT_ID
|
|
62
68
|
${pc.dim('--env <environment>')} Override FIGMA_ENVIRONMENT_NAME
|
|
63
|
-
${pc.dim('--yes, -y')} Skip
|
|
69
|
+
${pc.dim('--yes, -y')} Skip prompts; use safe defaults for project creation
|
|
70
|
+
${pc.dim('--name <name>')} New project name (default: package/directory name)
|
|
71
|
+
${pc.dim('--description <description>')} New project description (default: <name> project)
|
|
72
|
+
${pc.dim('--subdomain <subdomain>')} New project subdomain (default: generated from name)
|
|
73
|
+
${pc.dim('--workspace <plan-key>')} Workspace plan key (default workspace if omitted)
|
|
74
|
+
${pc.dim('--region <region>')} New project region (default: us-east-1 non-interactively)
|
|
64
75
|
${pc.dim('--skip-build')} Skip building and use existing build
|
|
65
76
|
${pc.dim('--skip-size-check')} Skip the client-side bundle size check
|
|
77
|
+
${pc.dim('--adapter <nextjs|nitro|vite>')} Override framework detection
|
|
78
|
+
${pc.dim('--output <path>')} Exact framework build output root
|
|
79
|
+
|
|
80
|
+
${pc.bold('SETUP AGENT COMMAND')}
|
|
81
|
+
|
|
82
|
+
${pc.cyan('@payloadcms/figma setup-agent')} Prompt for global or project installation
|
|
83
|
+
${pc.cyan('@payloadcms/figma setup-agent --global')} Install/update globally
|
|
84
|
+
${pc.cyan('@payloadcms/figma setup-agent --project')} Install/update in the current project
|
|
85
|
+
${pc.dim('--yes, -y')} Skip skills installer prompts
|
|
86
|
+
${pc.dim('Non-interactive use requires --global or --project.')}
|
|
66
87
|
|
|
67
88
|
${pc.bold('UPGRADE COMMAND')}
|
|
68
89
|
|