@payloadcms/codemod 4.0.0-internal.2a3c3bc → 4.0.0-internal.2d11d2e
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/README.md +1 -0
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +2 -0
- package/dist/registry.js.map +1 -1
- package/dist/runbook/v4.mdx +34 -5
- package/dist/transforms/migrate-displayed-field-value-args/basic.input.js +4 -0
- package/dist/transforms/migrate-displayed-field-value-args/basic.input.js.map +1 -0
- package/dist/transforms/migrate-displayed-field-value-args/basic.output.js +8 -0
- package/dist/transforms/migrate-displayed-field-value-args/basic.output.js.map +1 -0
- package/dist/transforms/migrate-displayed-field-value-args/index.d.ts +3 -0
- package/dist/transforms/migrate-displayed-field-value-args/index.d.ts.map +1 -0
- package/dist/transforms/migrate-displayed-field-value-args/index.js +84 -0
- package/dist/transforms/migrate-displayed-field-value-args/index.js.map +1 -0
- package/dist/transforms/migrate-displayed-field-value-args/namespace.input.js +4 -0
- package/dist/transforms/migrate-displayed-field-value-args/namespace.input.js.map +1 -0
- package/dist/transforms/migrate-displayed-field-value-args/namespace.output.js +8 -0
- package/dist/transforms/migrate-displayed-field-value-args/namespace.output.js.map +1 -0
- package/dist/transforms/migrate-displayed-field-value-args/no-match.input.js +4 -0
- package/dist/transforms/migrate-displayed-field-value-args/no-match.input.js.map +1 -0
- package/dist/transforms/migrate-displayed-field-value-args/no-match.output.js +4 -0
- package/dist/transforms/migrate-displayed-field-value-args/no-match.output.js.map +1 -0
- package/dist/upgrade/prompt.js +1 -1
- package/dist/upgrade/prompt.js.map +1 -1
- package/package.json +9 -11
package/README.md
CHANGED
|
@@ -84,6 +84,7 @@ The tool loads your project via [ts-morph](https://ts-morph.com/), using your `t
|
|
|
84
84
|
|
|
85
85
|
- `migrate-list-view-select-api`: Removes `admin.enableListViewSelectAPI` from Collection Configs. The List View's Select API is the default in v4.
|
|
86
86
|
- `migrate-disabled-fields`: migrates `field.admin.disableListColumn`, `disableListFilter`, `disableGroupBy`, `disableBulkEdit` and their equivalents on `imageSize.admin` into the consolidated `disabled` object form.
|
|
87
|
+
- `migrate-displayed-field-value-args`: converts direct `getDisplayedFieldValue(cellData, field, i18n)` calls imported from `@payloadcms/ui/utilities/getDisplayedFieldValue` to the object argument form. Handles named, aliased, and namespace imports. Indirect references and unsupported argument shapes are reported for manual migration.
|
|
87
88
|
- `globals-components-edit`: Globals: rename `admin.components.elements` to `admin.components.edit` and hoist `Description` to top-level `admin.components.Description` to match Collection conventions.
|
|
88
89
|
- `migrate-force-select`: migrates `forceSelect: { ... }` on Collection/Global configs to a `select` function that augments the caller's `select` when present and returns `undefined` (preserving full-document reads) when not. Shallow values become a spread (`{ ...select, ... }`); nested values use `deepMergeSimple` from `payload/shared` (auto-imported) to preserve the previous deep-merge semantics. Non-literal values, sibling `select` already present, and unsupported member kinds are surfaced as notes for manual review.
|
|
89
90
|
- `migrate-field-component-types`: replaces field component aliases—including concrete fields, canonical generics, labels, descriptions, errors, diffs, and block row labels—with the corresponding props types wrapped in `React.FC`. Generic arguments are preserved. Explicit class components, re-exports, namespace references, and inline imports are left unchanged with notes for manual migration.
|
package/dist/registry.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAuC3C,eAAO,MAAM,UAAU,EAAE,SAAS,EAqCjC,CAAA"}
|
package/dist/registry.js
CHANGED
|
@@ -10,6 +10,7 @@ import { migrateBlockReferencesToBlocks } from './transforms/migrate-block-refer
|
|
|
10
10
|
import { migrateBuildScript } from './transforms/migrate-build-script/index.js';
|
|
11
11
|
import { migrateDbTypesSubpath } from './transforms/migrate-db-types-subpath/index.js';
|
|
12
12
|
import { migrateDisabledFields } from './transforms/migrate-disabled-fields/index.js';
|
|
13
|
+
import { migrateDisplayedFieldValueArgs } from './transforms/migrate-displayed-field-value-args/index.js';
|
|
13
14
|
import { migrateDocumentTitleContext } from './transforms/migrate-document-title-context/index.js';
|
|
14
15
|
import { migrateFieldComponentTypes } from './transforms/migrate-field-component-types/index.js';
|
|
15
16
|
import { migrateForceSelect } from './transforms/migrate-force-select/index.js';
|
|
@@ -41,6 +42,7 @@ export const transforms = [
|
|
|
41
42
|
globalsComponentsEdit,
|
|
42
43
|
migrateListViewSelectAPI,
|
|
43
44
|
migrateDisabledFields,
|
|
45
|
+
migrateDisplayedFieldValueArgs,
|
|
44
46
|
migrateForceSelect,
|
|
45
47
|
migrateFieldComponentTypes,
|
|
46
48
|
renameDiffValueProps,
|
package/dist/registry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/registry.ts"],"sourcesContent":["import type { Transform } from './types.js'\n\nimport { addOverrideAccessTrue } from './transforms/add-override-access-true/index.js'\nimport { exampleNoop } from './transforms/example-noop/index.js'\nimport { globalsComponentsEdit } from './transforms/globals-components-edit/index.js'\nimport { migrateAdminContextProperties } from './transforms/migrate-admin-context-properties/index.js'\nimport { migrateAfterOperationRead } from './transforms/migrate-after-operation-read/index.js'\nimport { migrateAliasedExports } from './transforms/migrate-aliased-exports/index.js'\nimport { migrateAuthorshipDefault } from './transforms/migrate-authorship-default/index.js'\nimport { migrateAzureChunkLargeFiles } from './transforms/migrate-azure-chunk-large-files/index.js'\nimport { migrateBlockReferencesToBlocks } from './transforms/migrate-block-references-to-blocks/index.js'\nimport { migrateBuildScript } from './transforms/migrate-build-script/index.js'\nimport { migrateDbTypesSubpath } from './transforms/migrate-db-types-subpath/index.js'\nimport { migrateDisabledFields } from './transforms/migrate-disabled-fields/index.js'\nimport { migrateDocumentTitleContext } from './transforms/migrate-document-title-context/index.js'\nimport { migrateFieldComponentTypes } from './transforms/migrate-field-component-types/index.js'\nimport { migrateForceSelect } from './transforms/migrate-force-select/index.js'\nimport { migrateHideAPIURL } from './transforms/migrate-hide-api-url/index.js'\nimport { migrateImportExportHooks } from './transforms/migrate-import-export-hooks/index.js'\nimport { migrateListViewSelectAPI } from './transforms/migrate-list-view-select-api/index.js'\nimport { migrateNextGenerateViewportExport } from './transforms/migrate-next-generate-viewport-export/index.js'\nimport { migrateNextSubpathExports } from './transforms/migrate-next-subpath-exports/index.js'\nimport { migratePayloadRequestCreation } from './transforms/migrate-payload-request-creation/index.js'\nimport { migrateSharpToTransformer } from './transforms/migrate-sharp-to-transformer/index.js'\nimport { migrateSlugField } from './transforms/migrate-slug-field/index.js'\nimport { migrateStorageAdaptersToConfig } from './transforms/migrate-storage-adapters-to-config/index.js'\nimport { migrateVersionsDefault } from './transforms/migrate-versions-default/index.js'\nimport { removeDefaultLocalePublishOption } from './transforms/remove-default-locale-publish-option/index.js'\nimport { removeGroupByTrue } from './transforms/remove-group-by-true/index.js'\nimport { removeLocalizeStatusConfig } from './transforms/remove-localize-status-config/index.js'\nimport { removePublishSpecificLocale } from './transforms/remove-publish-specific-locale/index.js'\nimport { removeStorageAlwaysInsertFields } from './transforms/remove-storage-always-insert-fields/index.js'\nimport { removeVersionsTrue } from './transforms/remove-versions-true/index.js'\nimport { renameDiffValueProps } from './transforms/rename-diff-value-props/index.js'\nimport { renameExperimentalTableFeature } from './transforms/rename-experimental-table-feature/index.js'\nimport { renameStorageAdaptersToStorage } from './transforms/rename-storage-adapters-to-storage/index.js'\nimport { renameTypescriptSchemaToJsonSchema } from './transforms/rename-typescript-schema-to-json-schema/index.js'\n\nexport const transforms: Transform[] = [\n exampleNoop,\n addOverrideAccessTrue,\n migrateAfterOperationRead,\n migrateHideAPIURL,\n globalsComponentsEdit,\n migrateListViewSelectAPI,\n migrateDisabledFields,\n migrateForceSelect,\n migrateFieldComponentTypes,\n renameDiffValueProps,\n migrateAliasedExports,\n migratePayloadRequestCreation,\n migrateAdminContextProperties,\n migrateBlockReferencesToBlocks,\n migrateBuildScript,\n migrateDocumentTitleContext,\n migrateSharpToTransformer,\n migrateStorageAdaptersToConfig,\n migrateAzureChunkLargeFiles,\n renameStorageAdaptersToStorage,\n migrateImportExportHooks,\n migrateDbTypesSubpath,\n migrateNextGenerateViewportExport,\n migrateNextSubpathExports,\n migrateSlugField,\n migrateVersionsDefault,\n migrateAuthorshipDefault,\n removeDefaultLocalePublishOption,\n removeGroupByTrue,\n removeLocalizeStatusConfig,\n removeVersionsTrue,\n removePublishSpecificLocale,\n removeStorageAlwaysInsertFields,\n renameTypescriptSchemaToJsonSchema,\n renameExperimentalTableFeature,\n]\n"],"names":["addOverrideAccessTrue","exampleNoop","globalsComponentsEdit","migrateAdminContextProperties","migrateAfterOperationRead","migrateAliasedExports","migrateAuthorshipDefault","migrateAzureChunkLargeFiles","migrateBlockReferencesToBlocks","migrateBuildScript","migrateDbTypesSubpath","migrateDisabledFields","migrateDocumentTitleContext","migrateFieldComponentTypes","migrateForceSelect","migrateHideAPIURL","migrateImportExportHooks","migrateListViewSelectAPI","migrateNextGenerateViewportExport","migrateNextSubpathExports","migratePayloadRequestCreation","migrateSharpToTransformer","migrateSlugField","migrateStorageAdaptersToConfig","migrateVersionsDefault","removeDefaultLocalePublishOption","removeGroupByTrue","removeLocalizeStatusConfig","removePublishSpecificLocale","removeStorageAlwaysInsertFields","removeVersionsTrue","renameDiffValueProps","renameExperimentalTableFeature","renameStorageAdaptersToStorage","renameTypescriptSchemaToJsonSchema","transforms"],"mappings":"AAEA,SAASA,qBAAqB,QAAQ,iDAAgD;AACtF,SAASC,WAAW,QAAQ,qCAAoC;AAChE,SAASC,qBAAqB,QAAQ,gDAA+C;AACrF,SAASC,6BAA6B,QAAQ,yDAAwD;AACtG,SAASC,yBAAyB,QAAQ,qDAAoD;AAC9F,SAASC,qBAAqB,QAAQ,gDAA+C;AACrF,SAASC,wBAAwB,QAAQ,mDAAkD;AAC3F,SAASC,2BAA2B,QAAQ,wDAAuD;AACnG,SAASC,8BAA8B,QAAQ,2DAA0D;AACzG,SAASC,kBAAkB,QAAQ,6CAA4C;AAC/E,SAASC,qBAAqB,QAAQ,iDAAgD;AACtF,SAASC,qBAAqB,QAAQ,gDAA+C;AACrF,SAASC,2BAA2B,QAAQ,uDAAsD;AAClG,SAASC,0BAA0B,QAAQ,sDAAqD;AAChG,SAASC,kBAAkB,QAAQ,6CAA4C;AAC/E,SAASC,iBAAiB,QAAQ,6CAA4C;AAC9E,SAASC,wBAAwB,QAAQ,oDAAmD;AAC5F,SAASC,wBAAwB,QAAQ,qDAAoD;AAC7F,SAASC,iCAAiC,QAAQ,8DAA6D;AAC/G,SAASC,yBAAyB,QAAQ,qDAAoD;AAC9F,SAASC,6BAA6B,QAAQ,yDAAwD;AACtG,SAASC,yBAAyB,QAAQ,qDAAoD;AAC9F,SAASC,gBAAgB,QAAQ,2CAA0C;AAC3E,SAASC,8BAA8B,QAAQ,2DAA0D;AACzG,SAASC,sBAAsB,QAAQ,iDAAgD;AACvF,SAASC,gCAAgC,QAAQ,6DAA4D;AAC7G,SAASC,iBAAiB,QAAQ,6CAA4C;AAC9E,SAASC,0BAA0B,QAAQ,sDAAqD;AAChG,SAASC,2BAA2B,QAAQ,uDAAsD;AAClG,SAASC,+BAA+B,QAAQ,4DAA2D;AAC3G,SAASC,kBAAkB,QAAQ,6CAA4C;AAC/E,SAASC,oBAAoB,QAAQ,gDAA+C;AACpF,SAASC,8BAA8B,QAAQ,0DAAyD;AACxG,SAASC,8BAA8B,QAAQ,2DAA0D;AACzG,SAASC,kCAAkC,QAAQ,gEAA+D;AAElH,OAAO,MAAMC,aAA0B;
|
|
1
|
+
{"version":3,"sources":["../src/registry.ts"],"sourcesContent":["import type { Transform } from './types.js'\n\nimport { addOverrideAccessTrue } from './transforms/add-override-access-true/index.js'\nimport { exampleNoop } from './transforms/example-noop/index.js'\nimport { globalsComponentsEdit } from './transforms/globals-components-edit/index.js'\nimport { migrateAdminContextProperties } from './transforms/migrate-admin-context-properties/index.js'\nimport { migrateAfterOperationRead } from './transforms/migrate-after-operation-read/index.js'\nimport { migrateAliasedExports } from './transforms/migrate-aliased-exports/index.js'\nimport { migrateAuthorshipDefault } from './transforms/migrate-authorship-default/index.js'\nimport { migrateAzureChunkLargeFiles } from './transforms/migrate-azure-chunk-large-files/index.js'\nimport { migrateBlockReferencesToBlocks } from './transforms/migrate-block-references-to-blocks/index.js'\nimport { migrateBuildScript } from './transforms/migrate-build-script/index.js'\nimport { migrateDbTypesSubpath } from './transforms/migrate-db-types-subpath/index.js'\nimport { migrateDisabledFields } from './transforms/migrate-disabled-fields/index.js'\nimport { migrateDisplayedFieldValueArgs } from './transforms/migrate-displayed-field-value-args/index.js'\nimport { migrateDocumentTitleContext } from './transforms/migrate-document-title-context/index.js'\nimport { migrateFieldComponentTypes } from './transforms/migrate-field-component-types/index.js'\nimport { migrateForceSelect } from './transforms/migrate-force-select/index.js'\nimport { migrateHideAPIURL } from './transforms/migrate-hide-api-url/index.js'\nimport { migrateImportExportHooks } from './transforms/migrate-import-export-hooks/index.js'\nimport { migrateListViewSelectAPI } from './transforms/migrate-list-view-select-api/index.js'\nimport { migrateNextGenerateViewportExport } from './transforms/migrate-next-generate-viewport-export/index.js'\nimport { migrateNextSubpathExports } from './transforms/migrate-next-subpath-exports/index.js'\nimport { migratePayloadRequestCreation } from './transforms/migrate-payload-request-creation/index.js'\nimport { migrateSharpToTransformer } from './transforms/migrate-sharp-to-transformer/index.js'\nimport { migrateSlugField } from './transforms/migrate-slug-field/index.js'\nimport { migrateStorageAdaptersToConfig } from './transforms/migrate-storage-adapters-to-config/index.js'\nimport { migrateVersionsDefault } from './transforms/migrate-versions-default/index.js'\nimport { removeDefaultLocalePublishOption } from './transforms/remove-default-locale-publish-option/index.js'\nimport { removeGroupByTrue } from './transforms/remove-group-by-true/index.js'\nimport { removeLocalizeStatusConfig } from './transforms/remove-localize-status-config/index.js'\nimport { removePublishSpecificLocale } from './transforms/remove-publish-specific-locale/index.js'\nimport { removeStorageAlwaysInsertFields } from './transforms/remove-storage-always-insert-fields/index.js'\nimport { removeVersionsTrue } from './transforms/remove-versions-true/index.js'\nimport { renameDiffValueProps } from './transforms/rename-diff-value-props/index.js'\nimport { renameExperimentalTableFeature } from './transforms/rename-experimental-table-feature/index.js'\nimport { renameStorageAdaptersToStorage } from './transforms/rename-storage-adapters-to-storage/index.js'\nimport { renameTypescriptSchemaToJsonSchema } from './transforms/rename-typescript-schema-to-json-schema/index.js'\n\nexport const transforms: Transform[] = [\n exampleNoop,\n addOverrideAccessTrue,\n migrateAfterOperationRead,\n migrateHideAPIURL,\n globalsComponentsEdit,\n migrateListViewSelectAPI,\n migrateDisabledFields,\n migrateDisplayedFieldValueArgs,\n migrateForceSelect,\n migrateFieldComponentTypes,\n renameDiffValueProps,\n migrateAliasedExports,\n migratePayloadRequestCreation,\n migrateAdminContextProperties,\n migrateBlockReferencesToBlocks,\n migrateBuildScript,\n migrateDocumentTitleContext,\n migrateSharpToTransformer,\n migrateStorageAdaptersToConfig,\n migrateAzureChunkLargeFiles,\n renameStorageAdaptersToStorage,\n migrateImportExportHooks,\n migrateDbTypesSubpath,\n migrateNextGenerateViewportExport,\n migrateNextSubpathExports,\n migrateSlugField,\n migrateVersionsDefault,\n migrateAuthorshipDefault,\n removeDefaultLocalePublishOption,\n removeGroupByTrue,\n removeLocalizeStatusConfig,\n removeVersionsTrue,\n removePublishSpecificLocale,\n removeStorageAlwaysInsertFields,\n renameTypescriptSchemaToJsonSchema,\n renameExperimentalTableFeature,\n]\n"],"names":["addOverrideAccessTrue","exampleNoop","globalsComponentsEdit","migrateAdminContextProperties","migrateAfterOperationRead","migrateAliasedExports","migrateAuthorshipDefault","migrateAzureChunkLargeFiles","migrateBlockReferencesToBlocks","migrateBuildScript","migrateDbTypesSubpath","migrateDisabledFields","migrateDisplayedFieldValueArgs","migrateDocumentTitleContext","migrateFieldComponentTypes","migrateForceSelect","migrateHideAPIURL","migrateImportExportHooks","migrateListViewSelectAPI","migrateNextGenerateViewportExport","migrateNextSubpathExports","migratePayloadRequestCreation","migrateSharpToTransformer","migrateSlugField","migrateStorageAdaptersToConfig","migrateVersionsDefault","removeDefaultLocalePublishOption","removeGroupByTrue","removeLocalizeStatusConfig","removePublishSpecificLocale","removeStorageAlwaysInsertFields","removeVersionsTrue","renameDiffValueProps","renameExperimentalTableFeature","renameStorageAdaptersToStorage","renameTypescriptSchemaToJsonSchema","transforms"],"mappings":"AAEA,SAASA,qBAAqB,QAAQ,iDAAgD;AACtF,SAASC,WAAW,QAAQ,qCAAoC;AAChE,SAASC,qBAAqB,QAAQ,gDAA+C;AACrF,SAASC,6BAA6B,QAAQ,yDAAwD;AACtG,SAASC,yBAAyB,QAAQ,qDAAoD;AAC9F,SAASC,qBAAqB,QAAQ,gDAA+C;AACrF,SAASC,wBAAwB,QAAQ,mDAAkD;AAC3F,SAASC,2BAA2B,QAAQ,wDAAuD;AACnG,SAASC,8BAA8B,QAAQ,2DAA0D;AACzG,SAASC,kBAAkB,QAAQ,6CAA4C;AAC/E,SAASC,qBAAqB,QAAQ,iDAAgD;AACtF,SAASC,qBAAqB,QAAQ,gDAA+C;AACrF,SAASC,8BAA8B,QAAQ,2DAA0D;AACzG,SAASC,2BAA2B,QAAQ,uDAAsD;AAClG,SAASC,0BAA0B,QAAQ,sDAAqD;AAChG,SAASC,kBAAkB,QAAQ,6CAA4C;AAC/E,SAASC,iBAAiB,QAAQ,6CAA4C;AAC9E,SAASC,wBAAwB,QAAQ,oDAAmD;AAC5F,SAASC,wBAAwB,QAAQ,qDAAoD;AAC7F,SAASC,iCAAiC,QAAQ,8DAA6D;AAC/G,SAASC,yBAAyB,QAAQ,qDAAoD;AAC9F,SAASC,6BAA6B,QAAQ,yDAAwD;AACtG,SAASC,yBAAyB,QAAQ,qDAAoD;AAC9F,SAASC,gBAAgB,QAAQ,2CAA0C;AAC3E,SAASC,8BAA8B,QAAQ,2DAA0D;AACzG,SAASC,sBAAsB,QAAQ,iDAAgD;AACvF,SAASC,gCAAgC,QAAQ,6DAA4D;AAC7G,SAASC,iBAAiB,QAAQ,6CAA4C;AAC9E,SAASC,0BAA0B,QAAQ,sDAAqD;AAChG,SAASC,2BAA2B,QAAQ,uDAAsD;AAClG,SAASC,+BAA+B,QAAQ,4DAA2D;AAC3G,SAASC,kBAAkB,QAAQ,6CAA4C;AAC/E,SAASC,oBAAoB,QAAQ,gDAA+C;AACpF,SAASC,8BAA8B,QAAQ,0DAAyD;AACxG,SAASC,8BAA8B,QAAQ,2DAA0D;AACzG,SAASC,kCAAkC,QAAQ,gEAA+D;AAElH,OAAO,MAAMC,aAA0B;IACrCnC;IACAD;IACAI;IACAY;IACAd;IACAgB;IACAP;IACAC;IACAG;IACAD;IACAkB;IACA3B;IACAgB;IACAlB;IACAK;IACAC;IACAI;IACAS;IACAE;IACAjB;IACA2B;IACAjB;IACAP;IACAS;IACAC;IACAG;IACAE;IACAnB;IACAoB;IACAC;IACAC;IACAG;IACAF;IACAC;IACAK;IACAF;CACD,CAAA"}
|
package/dist/runbook/v4.mdx
CHANGED
|
@@ -771,7 +771,7 @@ export const myPlugin = definePlugin<MyPluginOptions>({
|
|
|
771
771
|
|
|
772
772
|
### Admin routing is now framework-agnostic
|
|
773
773
|
|
|
774
|
-
`@payloadcms/ui` no longer depends on `next` directly. Custom admin components (field components, custom views, plugins) that previously imported router hooks or the `Link` component from `next/*` must now import the framework-agnostic equivalents from `@payloadcms/ui`. Behavior is identical when running on Next.js — the `NextRouterAdapter` shipped by `@payloadcms/next` wires `next/navigation` hooks and `next/link` into the same context — but
|
|
774
|
+
`@payloadcms/ui` no longer depends on `next` directly. Custom admin components (field components, custom views, plugins) that previously imported router hooks or the `Link` component from `next/*` must now import the framework-agnostic equivalents from `@payloadcms/ui`. Behavior is identical when running on Next.js — the `NextRouterAdapter` shipped by `@payloadcms/next` wires `next/navigation` hooks and `next/link` into the same context — but UI code can now also run on non-Next adapters such as TanStack Start without modification.
|
|
775
775
|
|
|
776
776
|
**Hooks** — import from `@payloadcms/ui` instead of `next/navigation`:
|
|
777
777
|
|
|
@@ -1180,9 +1180,9 @@ The deprecated `findMigrationDir` re-export has been removed from `@payloadcms/d
|
|
|
1180
1180
|
+ import { findMigrationDir } from 'payload'
|
|
1181
1181
|
```
|
|
1182
1182
|
|
|
1183
|
-
### Minimum supported Node.js version is now 24.
|
|
1183
|
+
### Minimum supported Node.js version is now 24.22.1 ([#16540](https://github.com/payloadcms/payload/pull/16540))
|
|
1184
1184
|
|
|
1185
|
-
The minimum supported Node.js version is now **24.
|
|
1185
|
+
The minimum supported Node.js version is now **24.22.1** (previously 18.20.2). Upgrade your runtime — along with any CI, Docker images, and deployment targets — to the latest node LTS version or newer before upgrading to 4.0.
|
|
1186
1186
|
|
|
1187
1187
|
### Minimum supported Next.js version is now 16.4.0 ([#16537](https://github.com/payloadcms/payload/pull/16537))
|
|
1188
1188
|
|
|
@@ -1244,7 +1244,7 @@ The deprecated `isHTMLElement` utility has been removed from `@payloadcms/richte
|
|
|
1244
1244
|
|
|
1245
1245
|
### Lexical now uses the upstream Markdown package
|
|
1246
1246
|
|
|
1247
|
-
`@payloadcms/richtext-lexical` no longer ships a vendored copy of `@lexical/markdown`. The package is now a direct dependency, every `@lexical/*` package was upgraded from `0.41.0` to `0.
|
|
1247
|
+
`@payloadcms/richtext-lexical` no longer ships a vendored copy of `@lexical/markdown`. The package is now a direct dependency, every `@lexical/*` package was upgraded from `0.41.0` to `0.53.0`, and `@payloadcms/richtext-lexical/lexical/markdown` is a pure passthrough of `@lexical/markdown`.
|
|
1248
1248
|
|
|
1249
1249
|
Most projects use markdown through the editor or through `convertMarkdownToLexical` / `convertLexicalToMarkdown` and need no changes. You are only affected if you import from `@payloadcms/richtext-lexical/lexical/markdown` directly.
|
|
1250
1250
|
|
|
@@ -1268,7 +1268,9 @@ If you keep calling `$convertFromMarkdownString` directly, pass `editorConfig.fe
|
|
|
1268
1268
|
|
|
1269
1269
|
**Whitespace-only markdown table cells now import as an empty paragraph** instead of a text node of padding spaces. This comes from the lexical upgrade, not Payload's own code. No action is required unless you assert on those padding spaces in stored content.
|
|
1270
1270
|
|
|
1271
|
-
|
|
1271
|
+
**Markdown export escapes literal brackets and HTML-like text.** `convertLexicalToMarkdown` now writes text such as `[note]` as `[note]` and `<b>` as `<b>`, so literal text no longer turns into links or HTML when the Markdown is parsed again. Ordinary text such as `AT&T` and `a < b` is unchanged, and `convertMarkdownToLexical` restores the original text. No action is required unless you compare exported Markdown against fixed strings or pass it to a parser that does not decode numeric character references.
|
|
1272
|
+
|
|
1273
|
+
If you import lexical APIs directly through `@payloadcms/richtext-lexical/lexical/*`, also review the [lexical breaking changes](https://github.com/facebook/lexical/releases) between `0.41.0` and `0.53.0`. None of them require action for typical Payload usage.
|
|
1272
1274
|
|
|
1273
1275
|
If your app imports Lexical types or adds custom features, check these changes from `0.50.0`. They also apply to imports through `@payloadcms/richtext-lexical/lexical` and its subpaths:
|
|
1274
1276
|
|
|
@@ -1278,6 +1280,8 @@ If your app imports Lexical types or adds custom features, check these changes f
|
|
|
1278
1280
|
- `SerializedEditorState<T>`, `SerializedElementNode<T>`, and `SerializedRootNode<T>` no longer accept a type argument. Remove `<T>` if you only need the base node type. For a document with your own node types, use Payload's `TypedEditorState<T>` instead. Without a type argument, Lexical's `children` are still typed as `SerializedLexicalNode[]`.
|
|
1279
1281
|
- `ReturnType<Node['exportJSON']>` can now infer partial JSON, making fields such as `version` and `url` optional. If your code expects the full format, use the node's explicit serialized type, such as `SerializedLinkNode`. A normal `node.exportJSON()` call still returns the full format.
|
|
1280
1282
|
- `LexicalNode.getCommonAncestor` was removed. Use `$getCommonAncestor(a, b)?.commonAncestor ?? null`; pass the parents of non-element nodes if you need the old method's behavior.
|
|
1283
|
+
- Node traversal and key lookup methods no longer accept a type argument: `getParent<T>()`, `getParentOrThrow<T>()`, `getChildren<T>()`, `getFirstChild<T>()`, `getNextSibling<T>()`, `$getNodeByKey<T>()` and the rest of that family. Remove `<T>` and narrow the result with a node guard, for example `node.getChildren().filter($isTableCellNode)`. Runtime behavior is unchanged.
|
|
1284
|
+
- The deprecated `LinkImportExtension`, `ListImportExtension` and `RichTextImportExtension` were removed. Use `LinkExtension`, `ListExtension` and `RichTextExtension` instead. `HorizontalRuleImportExtension` was also removed; use `HorizontalRuleExtension` from `@lexical/extension` together with an extension that includes `CoreImportExtension`. The `*ImportRules` arrays remain.
|
|
1281
1285
|
|
|
1282
1286
|
### Lexical table support is no longer experimental
|
|
1283
1287
|
|
|
@@ -1874,6 +1878,15 @@ File versioning adds a required `GeneratedAdapter.copyFile` method. Copy `from`
|
|
|
1874
1878
|
|
|
1875
1879
|
Replace `clientUploadContext` with `uploadReference` in generated file metadata and static handler parameters. `handleUpload` no longer receives it because Payload skips uploading files that are already stored.
|
|
1876
1880
|
|
|
1881
|
+
Payload keeps only `_objectKey`, `prefix`, and `signedReceipt` at the top level of `uploadReference`, plus signed `adapterData` when `requiresUploadReceipt` is set. Read any other field your adapter or client added from `uploadReference.clientData`:
|
|
1882
|
+
|
|
1883
|
+
```diff
|
|
1884
|
+
- const objectID = uploadReference.providerObjectID
|
|
1885
|
+
+ const objectID = uploadReference.clientData?.providerObjectID
|
|
1886
|
+
```
|
|
1887
|
+
|
|
1888
|
+
`clientData` is not verified. To trust a value, sign it into the upload receipt as `adapterData` instead. See [Upload receipts](../upload/storage-adapters#custom-upload-receipts).
|
|
1889
|
+
|
|
1877
1890
|
Set `uploadInstructions.enabled`. When false, Payload adds `adminHandler` to the import map without rendering it. When true, Payload also renders it and exposes the instructions and supporting endpoint.
|
|
1878
1891
|
|
|
1879
1892
|
Move access checks into the generator or supporting endpoint that authorizes the upload:
|
|
@@ -2498,3 +2511,19 @@ export default buildConfig({
|
|
|
2498
2511
|
},
|
|
2499
2512
|
})
|
|
2500
2513
|
```
|
|
2514
|
+
|
|
2515
|
+
### Nodemailer adapter now uses nodemailer 10 ([#18737](https://github.com/payloadcms/payload/pull/18737))
|
|
2516
|
+
|
|
2517
|
+
`@payloadcms/email-nodemailer` now depends on nodemailer 10, which ships its own types. If you pass your own `transport` created with nodemailer 9, it no longer type-checks against the adapter. Upgrade `nodemailer` and remove `@types/nodemailer`:
|
|
2518
|
+
|
|
2519
|
+
```diff
|
|
2520
|
+
"dependencies": {
|
|
2521
|
+
- "nodemailer": "^9.1.1"
|
|
2522
|
+
+ "nodemailer": "^10.1.1"
|
|
2523
|
+
},
|
|
2524
|
+
"devDependencies": {
|
|
2525
|
+
- "@types/nodemailer": "^8.0.0"
|
|
2526
|
+
}
|
|
2527
|
+
```
|
|
2528
|
+
|
|
2529
|
+
If you use `transportOptions`, or pass no config, no changes are needed.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/transforms/migrate-displayed-field-value-args/basic.input.ts"],"sourcesContent":["import { getDisplayedFieldValue as display } from '@payloadcms/ui/utilities/getDisplayedFieldValue'\n\nconst result = display(fileSize, field, i18n)\n"],"names":["getDisplayedFieldValue","display","result","fileSize","field","i18n"],"mappings":"AAAA,SAASA,0BAA0BC,OAAO,QAAQ,kDAAiD;AAEnG,MAAMC,SAASD,QAAQE,UAAUC,OAAOC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/transforms/migrate-displayed-field-value-args/basic.output.ts"],"sourcesContent":["import { getDisplayedFieldValue as display } from '@payloadcms/ui/utilities/getDisplayedFieldValue'\n\nconst result = display({ cellData: fileSize, field: field, i18n: i18n })\n"],"names":["getDisplayedFieldValue","display","result","cellData","fileSize","field","i18n"],"mappings":"AAAA,SAASA,0BAA0BC,OAAO,QAAQ,kDAAiD;AAEnG,MAAMC,SAASD,QAAQ;IAAEE,UAAUC;IAAUC,OAAOA;IAAOC,MAAMA;AAAK"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/transforms/migrate-displayed-field-value-args/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAK/C,eAAO,MAAM,8BAA8B,EAAE,SA+D5C,CAAA"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { Node } from 'ts-morph';
|
|
2
|
+
const moduleName = '@payloadcms/ui/utilities/getDisplayedFieldValue';
|
|
3
|
+
const functionName = 'getDisplayedFieldValue';
|
|
4
|
+
export const migrateDisplayedFieldValueArgs = {
|
|
5
|
+
name: 'migrate-displayed-field-value-args',
|
|
6
|
+
apply: ({ project })=>{
|
|
7
|
+
const filesChanged = [];
|
|
8
|
+
const notes = [];
|
|
9
|
+
for (const file of project.getSourceFiles()){
|
|
10
|
+
const calls = new Set();
|
|
11
|
+
for (const declaration of file.getImportDeclarations()){
|
|
12
|
+
if (declaration.getModuleSpecifierValue() !== moduleName) {
|
|
13
|
+
continue;
|
|
14
|
+
}
|
|
15
|
+
for (const specifier of declaration.getNamedImports()){
|
|
16
|
+
if (specifier.getName() !== functionName || specifier.isTypeOnly()) {
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
const localName = specifier.getAliasNode() ?? specifier.getNameNode();
|
|
20
|
+
if (Node.isIdentifier(localName)) {
|
|
21
|
+
collectCalls({
|
|
22
|
+
calls,
|
|
23
|
+
localName,
|
|
24
|
+
notes
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
const namespace = declaration.getNamespaceImport();
|
|
29
|
+
if (namespace) {
|
|
30
|
+
collectCalls({
|
|
31
|
+
calls,
|
|
32
|
+
isNamespace: true,
|
|
33
|
+
localName: namespace,
|
|
34
|
+
notes
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
const original = file.getFullText();
|
|
39
|
+
for (const call of [
|
|
40
|
+
...calls
|
|
41
|
+
].sort((a, b)=>b.getStart() - a.getStart())){
|
|
42
|
+
const args = call.getArguments();
|
|
43
|
+
if (args.length === 1 && Node.isObjectLiteralExpression(args[0])) {
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
if (args.length !== 3 || args.some(Node.isSpreadElement)) {
|
|
47
|
+
notes.push(`${file.getFilePath()}:${call.getStartLineNumber()}: ${call.getText()} has unsupported arguments; migrate manually.`);
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
call.replaceWithText(`${call.getExpression().getText()}({ cellData: ${args[0].getText()}, field: ${args[1].getText()}, i18n: ${args[2].getText()} })`);
|
|
51
|
+
}
|
|
52
|
+
if (file.getFullText() !== original) {
|
|
53
|
+
filesChanged.push(file.getFilePath());
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
filesChanged,
|
|
58
|
+
...notes.length > 0 ? {
|
|
59
|
+
notes
|
|
60
|
+
} : {}
|
|
61
|
+
};
|
|
62
|
+
},
|
|
63
|
+
description: 'Migrates `getDisplayedFieldValue(cellData, field, i18n)` calls imported from `@payloadcms/ui/utilities/getDisplayedFieldValue` to object arguments.'
|
|
64
|
+
};
|
|
65
|
+
function collectCalls({ calls, isNamespace = false, localName, notes }) {
|
|
66
|
+
for (const reference of localName.findReferencesAsNodes()){
|
|
67
|
+
if (reference === localName) {
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
const parent = reference.getParent();
|
|
71
|
+
const expression = isNamespace ? Node.isPropertyAccessExpression(parent) && parent.getExpression() === reference && parent.getName() === functionName ? parent : undefined : reference;
|
|
72
|
+
if (!expression) {
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
const call = expression.getParent();
|
|
76
|
+
if (Node.isCallExpression(call) && call.getExpression() === expression) {
|
|
77
|
+
calls.add(call);
|
|
78
|
+
} else {
|
|
79
|
+
notes.push(`${reference.getSourceFile().getFilePath()}:${reference.getStartLineNumber()}: ${expression.getText()} is referenced without a direct call; migrate manually.`);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/transforms/migrate-displayed-field-value-args/index.ts"],"sourcesContent":["import type { CallExpression, Identifier } from 'ts-morph'\n\nimport { Node } from 'ts-morph'\n\nimport type { Transform } from '../../types.js'\n\nconst moduleName = '@payloadcms/ui/utilities/getDisplayedFieldValue'\nconst functionName = 'getDisplayedFieldValue'\n\nexport const migrateDisplayedFieldValueArgs: Transform = {\n name: 'migrate-displayed-field-value-args',\n apply: ({ project }) => {\n const filesChanged: string[] = []\n const notes: string[] = []\n\n for (const file of project.getSourceFiles()) {\n const calls = new Set<CallExpression>()\n\n for (const declaration of file.getImportDeclarations()) {\n if (declaration.getModuleSpecifierValue() !== moduleName) {\n continue\n }\n\n for (const specifier of declaration.getNamedImports()) {\n if (specifier.getName() !== functionName || specifier.isTypeOnly()) {\n continue\n }\n\n const localName = specifier.getAliasNode() ?? specifier.getNameNode()\n\n if (Node.isIdentifier(localName)) {\n collectCalls({ calls, localName, notes })\n }\n }\n\n const namespace = declaration.getNamespaceImport()\n\n if (namespace) {\n collectCalls({ calls, isNamespace: true, localName: namespace, notes })\n }\n }\n\n const original = file.getFullText()\n\n for (const call of [...calls].sort((a, b) => b.getStart() - a.getStart())) {\n const args = call.getArguments()\n\n if (args.length === 1 && Node.isObjectLiteralExpression(args[0])) {\n continue\n }\n\n if (args.length !== 3 || args.some(Node.isSpreadElement)) {\n notes.push(\n `${file.getFilePath()}:${call.getStartLineNumber()}: ${call.getText()} has unsupported arguments; migrate manually.`,\n )\n continue\n }\n\n call.replaceWithText(\n `${call.getExpression().getText()}({ cellData: ${args[0]!.getText()}, field: ${args[1]!.getText()}, i18n: ${args[2]!.getText()} })`,\n )\n }\n\n if (file.getFullText() !== original) {\n filesChanged.push(file.getFilePath())\n }\n }\n\n return { filesChanged, ...(notes.length > 0 ? { notes } : {}) }\n },\n description:\n 'Migrates `getDisplayedFieldValue(cellData, field, i18n)` calls imported from `@payloadcms/ui/utilities/getDisplayedFieldValue` to object arguments.',\n}\n\nfunction collectCalls({\n calls,\n isNamespace = false,\n localName,\n notes,\n}: {\n calls: Set<CallExpression>\n isNamespace?: boolean\n localName: Identifier\n notes: string[]\n}): void {\n for (const reference of localName.findReferencesAsNodes()) {\n if (reference === localName) {\n continue\n }\n\n const parent = reference.getParent()\n const expression = isNamespace\n ? Node.isPropertyAccessExpression(parent) &&\n parent.getExpression() === reference &&\n parent.getName() === functionName\n ? parent\n : undefined\n : reference\n\n if (!expression) {\n continue\n }\n\n const call = expression.getParent()\n\n if (Node.isCallExpression(call) && call.getExpression() === expression) {\n calls.add(call)\n } else {\n notes.push(\n `${reference.getSourceFile().getFilePath()}:${reference.getStartLineNumber()}: ${expression.getText()} is referenced without a direct call; migrate manually.`,\n )\n }\n }\n}\n"],"names":["Node","moduleName","functionName","migrateDisplayedFieldValueArgs","name","apply","project","filesChanged","notes","file","getSourceFiles","calls","Set","declaration","getImportDeclarations","getModuleSpecifierValue","specifier","getNamedImports","getName","isTypeOnly","localName","getAliasNode","getNameNode","isIdentifier","collectCalls","namespace","getNamespaceImport","isNamespace","original","getFullText","call","sort","a","b","getStart","args","getArguments","length","isObjectLiteralExpression","some","isSpreadElement","push","getFilePath","getStartLineNumber","getText","replaceWithText","getExpression","description","reference","findReferencesAsNodes","parent","getParent","expression","isPropertyAccessExpression","undefined","isCallExpression","add","getSourceFile"],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/transforms/migrate-displayed-field-value-args/namespace.input.ts"],"sourcesContent":["import * as display from '@payloadcms/ui/utilities/getDisplayedFieldValue'\n\nconst result = display.getDisplayedFieldValue(fileSize, field, i18n)\n"],"names":["display","result","getDisplayedFieldValue","fileSize","field","i18n"],"mappings":"AAAA,YAAYA,aAAa,kDAAiD;AAE1E,MAAMC,SAASD,QAAQE,sBAAsB,CAACC,UAAUC,OAAOC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/transforms/migrate-displayed-field-value-args/namespace.output.ts"],"sourcesContent":["import * as display from '@payloadcms/ui/utilities/getDisplayedFieldValue'\n\nconst result = display.getDisplayedFieldValue({ cellData: fileSize, field: field, i18n: i18n })\n"],"names":["display","result","getDisplayedFieldValue","cellData","fileSize","field","i18n"],"mappings":"AAAA,YAAYA,aAAa,kDAAiD;AAE1E,MAAMC,SAASD,QAAQE,sBAAsB,CAAC;IAAEC,UAAUC;IAAUC,OAAOA;IAAOC,MAAMA;AAAK"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/transforms/migrate-displayed-field-value-args/no-match.input.ts"],"sourcesContent":["import { getDisplayedFieldValue } from './local-display.js'\n\nconst result = getDisplayedFieldValue(fileSize, field, i18n)\n"],"names":["getDisplayedFieldValue","result","fileSize","field","i18n"],"mappings":"AAAA,SAASA,sBAAsB,QAAQ,qBAAoB;AAE3D,MAAMC,SAASD,uBAAuBE,UAAUC,OAAOC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/transforms/migrate-displayed-field-value-args/no-match.output.ts"],"sourcesContent":["import { getDisplayedFieldValue } from './local-display.js'\n\nconst result = getDisplayedFieldValue(fileSize, field, i18n)\n"],"names":["getDisplayedFieldValue","result","fileSize","field","i18n"],"mappings":"AAAA,SAASA,sBAAsB,QAAQ,qBAAoB;AAE3D,MAAMC,SAASD,uBAAuBE,UAAUC,OAAOC"}
|
package/dist/upgrade/prompt.js
CHANGED
|
@@ -16,7 +16,7 @@ Never report a task complete because the edit looks right. Confirm it. A silent
|
|
|
16
16
|
|
|
17
17
|
## 0. Preconditions
|
|
18
18
|
- Work on a clean git tree or a fresh branch.
|
|
19
|
-
- Use Node >=24.
|
|
19
|
+
- Use Node >=24.22.1 (the exact engines floor is printed by the command in step 2).
|
|
20
20
|
|
|
21
21
|
## 1. Pre-upgrade migrations (do these on v3, before touching versions)
|
|
22
22
|
Some migrations need the v3 tooling that v4 deletes, so they MUST run before the upgrade:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/upgrade/prompt.ts"],"sourcesContent":["/**\n * Render the overarching agent prompt for a full Payload v3 -> v4 upgrade,\n * Next.js 16 included. The prompt is a thin orchestrator: it sequences the\n * gates, runs this package's `upgrade` command for the deterministic slice,\n * delegates Next.js to Next's own agent workflow, and points at the migration\n * guide for the judgment work rather than restating any of it. The text is\n * project-agnostic (the agent runs it from the project root). `command` is the\n * token that re-invokes this CLI, so a local checkout points followers at the\n * local build instead of the published package. Pure: the caller prints it.\n */\nexport function renderUpgradePrompt({\n command = 'npx @payloadcms/codemod',\n}: { command?: string } = {}): string {\n return `You are upgrading this project from Payload v3 to v4, Next.js 16 included.\n\nGround rule: resolution over intent. A step is done only when it installs, builds, and boots.\nNever report a task complete because the edit looks right. Confirm it. A silent gap reads as\n\"checked and fine\".\n\n## 0. Preconditions\n- Work on a clean git tree or a fresh branch.\n- Use Node >=24.
|
|
1
|
+
{"version":3,"sources":["../../src/upgrade/prompt.ts"],"sourcesContent":["/**\n * Render the overarching agent prompt for a full Payload v3 -> v4 upgrade,\n * Next.js 16 included. The prompt is a thin orchestrator: it sequences the\n * gates, runs this package's `upgrade` command for the deterministic slice,\n * delegates Next.js to Next's own agent workflow, and points at the migration\n * guide for the judgment work rather than restating any of it. The text is\n * project-agnostic (the agent runs it from the project root). `command` is the\n * token that re-invokes this CLI, so a local checkout points followers at the\n * local build instead of the published package. Pure: the caller prints it.\n */\nexport function renderUpgradePrompt({\n command = 'npx @payloadcms/codemod',\n}: { command?: string } = {}): string {\n return `You are upgrading this project from Payload v3 to v4, Next.js 16 included.\n\nGround rule: resolution over intent. A step is done only when it installs, builds, and boots.\nNever report a task complete because the edit looks right. Confirm it. A silent gap reads as\n\"checked and fine\".\n\n## 0. Preconditions\n- Work on a clean git tree or a fresh branch.\n- Use Node >=24.22.1 (the exact engines floor is printed by the command in step 2).\n\n## 1. Pre-upgrade migrations (do these on v3, before touching versions)\nSome migrations need the v3 tooling that v4 deletes, so they MUST run before the upgrade:\n- Slate richtext is removed in v4. Migrate Slate -> Lexical while still on v3; the migration path\n is gone once the packages are pinned to v4.\n\nDo not proceed to step 2 until these are complete and committed.\n\n## 2. Payload mechanical slice\nRun this from the project root:\n\n ${command} upgrade run\n\nBy default it resolves Payload from the dist-tag this CLI was installed under (its own\nprerelease id, else \\`beta\\`). Add \\`--tag <dist-tag>\\` to pin a specific one.\nThis pins the Payload packages to v4, removes conflicting overrides, writes the toolchain\nfloors, installs, and runs the AST transforms. Read its report:\n- It prints the resolved payload version, the required Next target, and the path to the\n bundled runbook and migration guide. Use those paths below.\n- The unmet \\`@payloadcms/next\\` peer against Next 15 is EXPECTED at this point. Do NOT downgrade\n payload to satisfy it; step 3 resolves it by upgrading Next.\n- Do not hand-edit the versions it pinned.\n\n## 3. Next.js 16 (delegate to Next's workflow)\nPayload v4 requires Next 16. The command above did not touch Next. Run Next's own recommended\nagent workflow, which bumps Next + React and migrates the code as one unit:\n<https://nextjs.org/docs/app/guides/upgrading/version-16#use-an-ai-agent-recommended>\n\nIn short: run \\`npx @next/codemod@canary upgrade latest\\`, then\n\\`npx @next/codemod@canary next-async-request-api .\\`, and follow Next's AGENTS.md workflow for\nthe rest. Keep the result within the Next target range printed in step 2's report. Reinstall\nafterward so the \\`@payloadcms/next\\` peer resolves.\n\n## 4. Regenerate generated files\n\\`payload generate:types && payload generate:importmap\\`. Never hand-edit \\`payload-types.ts\\` or\n\\`importMap.js\\`; regenerate them.\n\n## 5. Fix-forward judgment work (against the now-v4 tree)\nThese depend on the v4 APIs and types existing, so they follow the upgrade. Open the bundled\nmigration guide (\\`v4.mdx\\`, path printed in step 2) and the bundled runbook\n(\\`runbook/payload-v4-upgrade.md\\`) and work the items they list: SCSS -> CSS and \\`--theme-*\\` ->\n\\`--color-*\\` token renames, Lexical union type-narrowing, jobs DB migrations, strict cron parsing,\nand anything flagged in the per-transform notes. Consult the guide for each; do not guess from\nmemory.\n\n## 6. Verify\n- \\`tsc --noEmit\\` (delete \\`tsconfig.tsbuildinfo\\` first; set \\`checkJs: true\\` so \\`importMap.js\\` is covered).\n- Run integration and e2e tests separately.\n- Build.\n- Confirm native modules (e.g. \\`sharp\\`) still load.\n\n## 7. Report\nDistinguish verified, cannot-confirm, and broken. Do not call the upgrade complete while any\ngate fails or any generated file is stale.\n`\n}\n"],"names":["renderUpgradePrompt","command"],"mappings":"AAAA;;;;;;;;;CASC,GACD,OAAO,SAASA,oBAAoB,EAClCC,UAAU,yBAAyB,EACd,GAAG,CAAC,CAAC;IAC1B,OAAO,CAAC;;;;;;;;;;;;;;;;;;;;IAoBN,EAAEA,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2Cd,CAAC;AACD"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payloadcms/codemod",
|
|
3
|
-
"version": "4.0.0-internal.
|
|
3
|
+
"version": "4.0.0-internal.2d11d2e",
|
|
4
4
|
"description": "Codemods for migrating Payload projects across versions.",
|
|
5
5
|
"homepage": "https://payloadcms.com",
|
|
6
|
-
"repository": {
|
|
7
|
-
"type": "git",
|
|
8
|
-
"url": "https://github.com/payloadcms/payload.git",
|
|
9
|
-
"directory": "packages/codemod"
|
|
10
|
-
},
|
|
11
6
|
"license": "MIT",
|
|
12
7
|
"author": "Payload <dev@payloadcms.com> (https://payloadcms.com)",
|
|
13
8
|
"maintainers": [
|
|
@@ -17,8 +12,11 @@
|
|
|
17
12
|
"url": "https://payloadcms.com"
|
|
18
13
|
}
|
|
19
14
|
],
|
|
20
|
-
"
|
|
21
|
-
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "https://github.com/payloadcms/payload.git",
|
|
18
|
+
"directory": "packages/codemod"
|
|
19
|
+
},
|
|
22
20
|
"bin": {
|
|
23
21
|
"payload-codemod": "bin/cli.js"
|
|
24
22
|
},
|
|
@@ -28,6 +26,8 @@
|
|
|
28
26
|
"dist",
|
|
29
27
|
"README.md"
|
|
30
28
|
],
|
|
29
|
+
"type": "module",
|
|
30
|
+
"sideEffects": false,
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@clack/prompts": "1.2.0",
|
|
33
33
|
"semver": "^7.8.5",
|
|
@@ -42,15 +42,13 @@
|
|
|
42
42
|
"vitest": "5.0.1"
|
|
43
43
|
},
|
|
44
44
|
"engines": {
|
|
45
|
-
"node": ">=24.
|
|
45
|
+
"node": ">=24.22.1"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
48
|
"build": "pnpm typecheck && pnpm build:swc && pnpm build:copy-docs",
|
|
49
49
|
"build:copy-docs": "node scripts/copy-migration-guide.mjs",
|
|
50
50
|
"build:swc": "swc ./src -d ./dist --config-file .swcrc --strip-leading-paths",
|
|
51
51
|
"clean": "rimraf -g {dist,*.tsbuildinfo}",
|
|
52
|
-
"lint": "eslint .",
|
|
53
|
-
"lint:fix": "eslint . --fix",
|
|
54
52
|
"test": "vitest --run",
|
|
55
53
|
"typecheck": "tsc"
|
|
56
54
|
}
|