@payloadcms/codemod 4.0.0-canary.15
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 +22 -0
- package/README.md +62 -0
- package/bin/cli.js +8 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +120 -0
- package/dist/cli.js.map +1 -0
- package/dist/cli.parseFlags.d.ts +9 -0
- package/dist/cli.parseFlags.d.ts.map +1 -0
- package/dist/cli.parseFlags.js +37 -0
- package/dist/cli.parseFlags.js.map +1 -0
- package/dist/cli.parseFlags.spec.d.ts +2 -0
- package/dist/cli.parseFlags.spec.d.ts.map +1 -0
- package/dist/cli.parseFlags.spec.js +49 -0
- package/dist/cli.parseFlags.spec.js.map +1 -0
- package/dist/registry.d.ts +3 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +54 -0
- package/dist/registry.js.map +1 -0
- package/dist/runner.d.ts +17 -0
- package/dist/runner.d.ts.map +1 -0
- package/dist/runner.js +37 -0
- package/dist/runner.js.map +1 -0
- package/dist/runner.spec.d.ts +2 -0
- package/dist/runner.spec.d.ts.map +1 -0
- package/dist/runner.spec.js +88 -0
- package/dist/runner.spec.js.map +1 -0
- package/dist/transforms/example-noop/basic.input.js +3 -0
- package/dist/transforms/example-noop/basic.input.js.map +1 -0
- package/dist/transforms/example-noop/basic.output.js +3 -0
- package/dist/transforms/example-noop/basic.output.js.map +1 -0
- package/dist/transforms/example-noop/index.d.ts +3 -0
- package/dist/transforms/example-noop/index.d.ts.map +1 -0
- package/dist/transforms/example-noop/index.js +9 -0
- package/dist/transforms/example-noop/index.js.map +1 -0
- package/dist/transforms/example-noop/index.spec.d.ts +2 -0
- package/dist/transforms/example-noop/index.spec.d.ts.map +1 -0
- package/dist/transforms/example-noop/index.spec.js +29 -0
- package/dist/transforms/example-noop/index.spec.js.map +1 -0
- package/dist/transforms/globals-components-edit/basic.input.js +23 -0
- package/dist/transforms/globals-components-edit/basic.input.js.map +1 -0
- package/dist/transforms/globals-components-edit/basic.output.js +23 -0
- package/dist/transforms/globals-components-edit/basic.output.js.map +1 -0
- package/dist/transforms/globals-components-edit/collection.input.js +19 -0
- package/dist/transforms/globals-components-edit/collection.input.js.map +1 -0
- package/dist/transforms/globals-components-edit/index.d.ts +3 -0
- package/dist/transforms/globals-components-edit/index.d.ts.map +1 -0
- package/dist/transforms/globals-components-edit/index.js +92 -0
- package/dist/transforms/globals-components-edit/index.js.map +1 -0
- package/dist/transforms/globals-components-edit/index.spec.d.ts +2 -0
- package/dist/transforms/globals-components-edit/index.spec.d.ts.map +1 -0
- package/dist/transforms/globals-components-edit/index.spec.js +37 -0
- package/dist/transforms/globals-components-edit/index.spec.js.map +1 -0
- package/dist/transforms/migrate-after-operation-read/alias.input.js +16 -0
- package/dist/transforms/migrate-after-operation-read/alias.input.js.map +1 -0
- package/dist/transforms/migrate-after-operation-read/alias.output.js +16 -0
- package/dist/transforms/migrate-after-operation-read/alias.output.js.map +1 -0
- package/dist/transforms/migrate-after-operation-read/basic.input.js +19 -0
- package/dist/transforms/migrate-after-operation-read/basic.input.js.map +1 -0
- package/dist/transforms/migrate-after-operation-read/basic.output.js +19 -0
- package/dist/transforms/migrate-after-operation-read/basic.output.js.map +1 -0
- package/dist/transforms/migrate-after-operation-read/external.input.js +12 -0
- package/dist/transforms/migrate-after-operation-read/external.input.js.map +1 -0
- package/dist/transforms/migrate-after-operation-read/index.d.ts +3 -0
- package/dist/transforms/migrate-after-operation-read/index.d.ts.map +1 -0
- package/dist/transforms/migrate-after-operation-read/index.js +148 -0
- package/dist/transforms/migrate-after-operation-read/index.js.map +1 -0
- package/dist/transforms/migrate-after-operation-read/index.spec.d.ts +2 -0
- package/dist/transforms/migrate-after-operation-read/index.spec.d.ts.map +1 -0
- package/dist/transforms/migrate-after-operation-read/index.spec.js +62 -0
- package/dist/transforms/migrate-after-operation-read/index.spec.js.map +1 -0
- package/dist/transforms/migrate-after-operation-read/non-matching.input.js +16 -0
- package/dist/transforms/migrate-after-operation-read/non-matching.input.js.map +1 -0
- package/dist/transforms/migrate-aliased-exports/basic.input.js +9 -0
- package/dist/transforms/migrate-aliased-exports/basic.input.js.map +1 -0
- package/dist/transforms/migrate-aliased-exports/basic.output.js +9 -0
- package/dist/transforms/migrate-aliased-exports/basic.output.js.map +1 -0
- package/dist/transforms/migrate-aliased-exports/index.d.ts +3 -0
- package/dist/transforms/migrate-aliased-exports/index.d.ts.map +1 -0
- package/dist/transforms/migrate-aliased-exports/index.js +215 -0
- package/dist/transforms/migrate-aliased-exports/index.js.map +1 -0
- package/dist/transforms/migrate-aliased-exports/index.spec.d.ts +2 -0
- package/dist/transforms/migrate-aliased-exports/index.spec.d.ts.map +1 -0
- package/dist/transforms/migrate-aliased-exports/index.spec.js +55 -0
- package/dist/transforms/migrate-aliased-exports/index.spec.js.map +1 -0
- package/dist/transforms/migrate-aliased-exports/merge.input.js +6 -0
- package/dist/transforms/migrate-aliased-exports/merge.input.js.map +1 -0
- package/dist/transforms/migrate-aliased-exports/merge.output.js +6 -0
- package/dist/transforms/migrate-aliased-exports/merge.output.js.map +1 -0
- package/dist/transforms/migrate-aliased-exports/non-matching.input.js +6 -0
- package/dist/transforms/migrate-aliased-exports/non-matching.input.js.map +1 -0
- package/dist/transforms/migrate-aliased-exports/rename.input.js +3 -0
- package/dist/transforms/migrate-aliased-exports/rename.input.js.map +1 -0
- package/dist/transforms/migrate-aliased-exports/rename.output.js +3 -0
- package/dist/transforms/migrate-aliased-exports/rename.output.js.map +1 -0
- package/dist/transforms/migrate-azure-chunk-large-files/basic.input.js +16 -0
- package/dist/transforms/migrate-azure-chunk-large-files/basic.input.js.map +1 -0
- package/dist/transforms/migrate-azure-chunk-large-files/basic.output.js +14 -0
- package/dist/transforms/migrate-azure-chunk-large-files/basic.output.js.map +1 -0
- package/dist/transforms/migrate-azure-chunk-large-files/index.d.ts +3 -0
- package/dist/transforms/migrate-azure-chunk-large-files/index.d.ts.map +1 -0
- package/dist/transforms/migrate-azure-chunk-large-files/index.js +49 -0
- package/dist/transforms/migrate-azure-chunk-large-files/index.js.map +1 -0
- package/dist/transforms/migrate-azure-chunk-large-files/index.spec.d.ts +2 -0
- package/dist/transforms/migrate-azure-chunk-large-files/index.spec.d.ts.map +1 -0
- package/dist/transforms/migrate-azure-chunk-large-files/index.spec.js +67 -0
- package/dist/transforms/migrate-azure-chunk-large-files/index.spec.js.map +1 -0
- package/dist/transforms/migrate-azure-chunk-large-files/no-match.input.js +14 -0
- package/dist/transforms/migrate-azure-chunk-large-files/no-match.input.js.map +1 -0
- package/dist/transforms/migrate-azure-chunk-large-files/no-match.output.js +14 -0
- package/dist/transforms/migrate-azure-chunk-large-files/no-match.output.js.map +1 -0
- package/dist/transforms/migrate-azure-chunk-large-files/with-access.input.js +17 -0
- package/dist/transforms/migrate-azure-chunk-large-files/with-access.input.js.map +1 -0
- package/dist/transforms/migrate-azure-chunk-large-files/with-access.output.js +16 -0
- package/dist/transforms/migrate-azure-chunk-large-files/with-access.output.js.map +1 -0
- package/dist/transforms/migrate-block-references-to-blocks/basic.input.js +27 -0
- package/dist/transforms/migrate-block-references-to-blocks/basic.input.js.map +1 -0
- package/dist/transforms/migrate-block-references-to-blocks/basic.output.js +26 -0
- package/dist/transforms/migrate-block-references-to-blocks/basic.output.js.map +1 -0
- package/dist/transforms/migrate-block-references-to-blocks/index.d.ts +3 -0
- package/dist/transforms/migrate-block-references-to-blocks/index.d.ts.map +1 -0
- package/dist/transforms/migrate-block-references-to-blocks/index.js +76 -0
- package/dist/transforms/migrate-block-references-to-blocks/index.js.map +1 -0
- package/dist/transforms/migrate-block-references-to-blocks/index.spec.d.ts +2 -0
- package/dist/transforms/migrate-block-references-to-blocks/index.spec.d.ts.map +1 -0
- package/dist/transforms/migrate-block-references-to-blocks/index.spec.js +45 -0
- package/dist/transforms/migrate-block-references-to-blocks/index.spec.js.map +1 -0
- package/dist/transforms/migrate-block-references-to-blocks/non-matching.input.js +20 -0
- package/dist/transforms/migrate-block-references-to-blocks/non-matching.input.js.map +1 -0
- package/dist/transforms/migrate-block-references-to-blocks/sibling.input.js +21 -0
- package/dist/transforms/migrate-block-references-to-blocks/sibling.input.js.map +1 -0
- package/dist/transforms/migrate-build-script/index.d.ts +3 -0
- package/dist/transforms/migrate-build-script/index.d.ts.map +1 -0
- package/dist/transforms/migrate-build-script/index.js +28 -0
- package/dist/transforms/migrate-build-script/index.js.map +1 -0
- package/dist/transforms/migrate-build-script/index.spec.d.ts +2 -0
- package/dist/transforms/migrate-build-script/index.spec.d.ts.map +1 -0
- package/dist/transforms/migrate-build-script/index.spec.js +81 -0
- package/dist/transforms/migrate-build-script/index.spec.js.map +1 -0
- package/dist/transforms/migrate-db-types-subpath/basic.input.js +3 -0
- package/dist/transforms/migrate-db-types-subpath/basic.input.js.map +1 -0
- package/dist/transforms/migrate-db-types-subpath/basic.output.js +3 -0
- package/dist/transforms/migrate-db-types-subpath/basic.output.js.map +1 -0
- package/dist/transforms/migrate-db-types-subpath/index.d.ts +3 -0
- package/dist/transforms/migrate-db-types-subpath/index.d.ts.map +1 -0
- package/dist/transforms/migrate-db-types-subpath/index.js +56 -0
- package/dist/transforms/migrate-db-types-subpath/index.js.map +1 -0
- package/dist/transforms/migrate-db-types-subpath/index.spec.d.ts +2 -0
- package/dist/transforms/migrate-db-types-subpath/index.spec.d.ts.map +1 -0
- package/dist/transforms/migrate-db-types-subpath/index.spec.js +46 -0
- package/dist/transforms/migrate-db-types-subpath/index.spec.js.map +1 -0
- package/dist/transforms/migrate-db-types-subpath/module-augmentation.input.js +2 -0
- package/dist/transforms/migrate-db-types-subpath/module-augmentation.input.js.map +1 -0
- package/dist/transforms/migrate-db-types-subpath/module-augmentation.output.js +2 -0
- package/dist/transforms/migrate-db-types-subpath/module-augmentation.output.js.map +1 -0
- package/dist/transforms/migrate-db-types-subpath/non-matching.input.js +3 -0
- package/dist/transforms/migrate-db-types-subpath/non-matching.input.js.map +1 -0
- package/dist/transforms/migrate-disabled-fields/basic.input.js +27 -0
- package/dist/transforms/migrate-disabled-fields/basic.input.js.map +1 -0
- package/dist/transforms/migrate-disabled-fields/basic.output.js +31 -0
- package/dist/transforms/migrate-disabled-fields/basic.output.js.map +1 -0
- package/dist/transforms/migrate-disabled-fields/imagesize.input.js +32 -0
- package/dist/transforms/migrate-disabled-fields/imagesize.input.js.map +1 -0
- package/dist/transforms/migrate-disabled-fields/imagesize.output.js +36 -0
- package/dist/transforms/migrate-disabled-fields/imagesize.output.js.map +1 -0
- package/dist/transforms/migrate-disabled-fields/index.d.ts +3 -0
- package/dist/transforms/migrate-disabled-fields/index.d.ts.map +1 -0
- package/dist/transforms/migrate-disabled-fields/index.js +124 -0
- package/dist/transforms/migrate-disabled-fields/index.js.map +1 -0
- package/dist/transforms/migrate-disabled-fields/index.spec.d.ts +2 -0
- package/dist/transforms/migrate-disabled-fields/index.spec.d.ts.map +1 -0
- package/dist/transforms/migrate-disabled-fields/index.spec.js +73 -0
- package/dist/transforms/migrate-disabled-fields/index.spec.js.map +1 -0
- package/dist/transforms/migrate-disabled-fields/merge.input.js +17 -0
- package/dist/transforms/migrate-disabled-fields/merge.input.js.map +1 -0
- package/dist/transforms/migrate-disabled-fields/merge.output.js +17 -0
- package/dist/transforms/migrate-disabled-fields/merge.output.js.map +1 -0
- package/dist/transforms/migrate-disabled-fields/non-matching.input.js +8 -0
- package/dist/transforms/migrate-disabled-fields/non-matching.input.js.map +1 -0
- package/dist/transforms/migrate-disabled-fields/non-matching.output.js +8 -0
- package/dist/transforms/migrate-disabled-fields/non-matching.output.js.map +1 -0
- package/dist/transforms/migrate-disabled-fields/preserve-true.input.js +16 -0
- package/dist/transforms/migrate-disabled-fields/preserve-true.input.js.map +1 -0
- package/dist/transforms/migrate-disabled-fields/preserve-true.output.js +14 -0
- package/dist/transforms/migrate-disabled-fields/preserve-true.output.js.map +1 -0
- package/dist/transforms/migrate-document-title-context/basic.input.js +23 -0
- package/dist/transforms/migrate-document-title-context/basic.input.js.map +1 -0
- package/dist/transforms/migrate-document-title-context/basic.output.js +25 -0
- package/dist/transforms/migrate-document-title-context/basic.output.js.map +1 -0
- package/dist/transforms/migrate-document-title-context/index.d.ts +3 -0
- package/dist/transforms/migrate-document-title-context/index.d.ts.map +1 -0
- package/dist/transforms/migrate-document-title-context/index.js +133 -0
- package/dist/transforms/migrate-document-title-context/index.js.map +1 -0
- package/dist/transforms/migrate-document-title-context/index.spec.d.ts +2 -0
- package/dist/transforms/migrate-document-title-context/index.spec.d.ts.map +1 -0
- package/dist/transforms/migrate-document-title-context/index.spec.js +86 -0
- package/dist/transforms/migrate-document-title-context/index.spec.js.map +1 -0
- package/dist/transforms/migrate-document-title-context/no-match.input.js +21 -0
- package/dist/transforms/migrate-document-title-context/no-match.input.js.map +1 -0
- package/dist/transforms/migrate-document-title-context/no-match.output.js +21 -0
- package/dist/transforms/migrate-document-title-context/no-match.output.js.map +1 -0
- package/dist/transforms/migrate-force-select/basic.input.js +10 -0
- package/dist/transforms/migrate-force-select/basic.input.js.map +1 -0
- package/dist/transforms/migrate-force-select/basic.output.js +11 -0
- package/dist/transforms/migrate-force-select/basic.output.js.map +1 -0
- package/dist/transforms/migrate-force-select/index.d.ts +3 -0
- package/dist/transforms/migrate-force-select/index.d.ts.map +1 -0
- package/dist/transforms/migrate-force-select/index.js +104 -0
- package/dist/transforms/migrate-force-select/index.js.map +1 -0
- package/dist/transforms/migrate-force-select/index.spec.d.ts +2 -0
- package/dist/transforms/migrate-force-select/index.spec.d.ts.map +1 -0
- package/dist/transforms/migrate-force-select/index.spec.js +107 -0
- package/dist/transforms/migrate-force-select/index.spec.js.map +1 -0
- package/dist/transforms/migrate-force-select/no-match.input.js +12 -0
- package/dist/transforms/migrate-force-select/no-match.input.js.map +1 -0
- package/dist/transforms/migrate-force-select/no-match.output.js +12 -0
- package/dist/transforms/migrate-force-select/no-match.output.js.map +1 -0
- package/dist/transforms/migrate-hide-api-url/basic.input.js +9 -0
- package/dist/transforms/migrate-hide-api-url/basic.input.js.map +1 -0
- package/dist/transforms/migrate-hide-api-url/basic.output.js +19 -0
- package/dist/transforms/migrate-hide-api-url/basic.output.js.map +1 -0
- package/dist/transforms/migrate-hide-api-url/index.d.ts +3 -0
- package/dist/transforms/migrate-hide-api-url/index.d.ts.map +1 -0
- package/dist/transforms/migrate-hide-api-url/index.js +85 -0
- package/dist/transforms/migrate-hide-api-url/index.js.map +1 -0
- package/dist/transforms/migrate-hide-api-url/index.spec.d.ts +2 -0
- package/dist/transforms/migrate-hide-api-url/index.spec.d.ts.map +1 -0
- package/dist/transforms/migrate-hide-api-url/index.spec.js +118 -0
- package/dist/transforms/migrate-hide-api-url/index.spec.js.map +1 -0
- package/dist/transforms/migrate-hide-api-url/no-match.input.js +12 -0
- package/dist/transforms/migrate-hide-api-url/no-match.input.js.map +1 -0
- package/dist/transforms/migrate-hide-api-url/no-match.output.js +12 -0
- package/dist/transforms/migrate-hide-api-url/no-match.output.js.map +1 -0
- package/dist/transforms/migrate-import-export-hooks/basic.input.js +16 -0
- package/dist/transforms/migrate-import-export-hooks/basic.input.js.map +1 -0
- package/dist/transforms/migrate-import-export-hooks/basic.output.js +18 -0
- package/dist/transforms/migrate-import-export-hooks/basic.output.js.map +1 -0
- package/dist/transforms/migrate-import-export-hooks/both.input.js +18 -0
- package/dist/transforms/migrate-import-export-hooks/both.input.js.map +1 -0
- package/dist/transforms/migrate-import-export-hooks/both.output.js +20 -0
- package/dist/transforms/migrate-import-export-hooks/both.output.js.map +1 -0
- package/dist/transforms/migrate-import-export-hooks/existing-hooks.input.js +20 -0
- package/dist/transforms/migrate-import-export-hooks/existing-hooks.input.js.map +1 -0
- package/dist/transforms/migrate-import-export-hooks/existing-hooks.output.js +20 -0
- package/dist/transforms/migrate-import-export-hooks/existing-hooks.output.js.map +1 -0
- package/dist/transforms/migrate-import-export-hooks/hooks-priority.input.js +19 -0
- package/dist/transforms/migrate-import-export-hooks/hooks-priority.input.js.map +1 -0
- package/dist/transforms/migrate-import-export-hooks/hooks-priority.output.js +18 -0
- package/dist/transforms/migrate-import-export-hooks/hooks-priority.output.js.map +1 -0
- package/dist/transforms/migrate-import-export-hooks/index.d.ts +3 -0
- package/dist/transforms/migrate-import-export-hooks/index.d.ts.map +1 -0
- package/dist/transforms/migrate-import-export-hooks/index.js +88 -0
- package/dist/transforms/migrate-import-export-hooks/index.js.map +1 -0
- package/dist/transforms/migrate-import-export-hooks/index.spec.d.ts +2 -0
- package/dist/transforms/migrate-import-export-hooks/index.spec.d.ts.map +1 -0
- package/dist/transforms/migrate-import-export-hooks/index.spec.js +65 -0
- package/dist/transforms/migrate-import-export-hooks/index.spec.js.map +1 -0
- package/dist/transforms/migrate-import-export-hooks/non-matching.input.js +19 -0
- package/dist/transforms/migrate-import-export-hooks/non-matching.input.js.map +1 -0
- package/dist/transforms/migrate-import-export-hooks/non-matching.output.js +19 -0
- package/dist/transforms/migrate-import-export-hooks/non-matching.output.js.map +1 -0
- package/dist/transforms/migrate-list-view-select-api/basic.input.js +15 -0
- package/dist/transforms/migrate-list-view-select-api/basic.input.js.map +1 -0
- package/dist/transforms/migrate-list-view-select-api/basic.output.js +14 -0
- package/dist/transforms/migrate-list-view-select-api/basic.output.js.map +1 -0
- package/dist/transforms/migrate-list-view-select-api/index.d.ts +3 -0
- package/dist/transforms/migrate-list-view-select-api/index.d.ts.map +1 -0
- package/dist/transforms/migrate-list-view-select-api/index.js +38 -0
- package/dist/transforms/migrate-list-view-select-api/index.js.map +1 -0
- package/dist/transforms/migrate-list-view-select-api/index.spec.d.ts +2 -0
- package/dist/transforms/migrate-list-view-select-api/index.spec.d.ts.map +1 -0
- package/dist/transforms/migrate-list-view-select-api/index.spec.js +37 -0
- package/dist/transforms/migrate-list-view-select-api/index.spec.js.map +1 -0
- package/dist/transforms/migrate-list-view-select-api/no-match.input.js +17 -0
- package/dist/transforms/migrate-list-view-select-api/no-match.input.js.map +1 -0
- package/dist/transforms/migrate-next-generate-viewport-export/basic.input.js +22 -0
- package/dist/transforms/migrate-next-generate-viewport-export/basic.input.js.map +1 -0
- package/dist/transforms/migrate-next-generate-viewport-export/basic.output.js +23 -0
- package/dist/transforms/migrate-next-generate-viewport-export/basic.output.js.map +1 -0
- package/dist/transforms/migrate-next-generate-viewport-export/index.d.ts +3 -0
- package/dist/transforms/migrate-next-generate-viewport-export/index.d.ts.map +1 -0
- package/dist/transforms/migrate-next-generate-viewport-export/index.js +69 -0
- package/dist/transforms/migrate-next-generate-viewport-export/index.js.map +1 -0
- package/dist/transforms/migrate-next-generate-viewport-export/index.spec.d.ts +2 -0
- package/dist/transforms/migrate-next-generate-viewport-export/index.spec.d.ts.map +1 -0
- package/dist/transforms/migrate-next-generate-viewport-export/index.spec.js +41 -0
- package/dist/transforms/migrate-next-generate-viewport-export/index.spec.js.map +1 -0
- package/dist/transforms/migrate-next-generate-viewport-export/non-matching.input.js +8 -0
- package/dist/transforms/migrate-next-generate-viewport-export/non-matching.input.js.map +1 -0
- package/dist/transforms/migrate-next-generate-viewport-export/non-matching.output.js +8 -0
- package/dist/transforms/migrate-next-generate-viewport-export/non-matching.output.js.map +1 -0
- package/dist/transforms/migrate-next-subpath-exports/basic.input.js +20 -0
- package/dist/transforms/migrate-next-subpath-exports/basic.input.js.map +1 -0
- package/dist/transforms/migrate-next-subpath-exports/basic.output.js +20 -0
- package/dist/transforms/migrate-next-subpath-exports/basic.output.js.map +1 -0
- package/dist/transforms/migrate-next-subpath-exports/index.d.ts +3 -0
- package/dist/transforms/migrate-next-subpath-exports/index.d.ts.map +1 -0
- package/dist/transforms/migrate-next-subpath-exports/index.js +92 -0
- package/dist/transforms/migrate-next-subpath-exports/index.js.map +1 -0
- package/dist/transforms/migrate-next-subpath-exports/index.spec.d.ts +2 -0
- package/dist/transforms/migrate-next-subpath-exports/index.spec.d.ts.map +1 -0
- package/dist/transforms/migrate-next-subpath-exports/index.spec.js +46 -0
- package/dist/transforms/migrate-next-subpath-exports/index.spec.js.map +1 -0
- package/dist/transforms/migrate-next-subpath-exports/non-matching.input.js +22 -0
- package/dist/transforms/migrate-next-subpath-exports/non-matching.input.js.map +1 -0
- package/dist/transforms/migrate-next-subpath-exports/re-export.input.js +5 -0
- package/dist/transforms/migrate-next-subpath-exports/re-export.input.js.map +1 -0
- package/dist/transforms/migrate-next-subpath-exports/re-export.output.js +5 -0
- package/dist/transforms/migrate-next-subpath-exports/re-export.output.js.map +1 -0
- package/dist/transforms/migrate-slug-field/basic.input.js +21 -0
- package/dist/transforms/migrate-slug-field/basic.input.js.map +1 -0
- package/dist/transforms/migrate-slug-field/basic.output.js +26 -0
- package/dist/transforms/migrate-slug-field/basic.output.js.map +1 -0
- package/dist/transforms/migrate-slug-field/index.d.ts +3 -0
- package/dist/transforms/migrate-slug-field/index.d.ts.map +1 -0
- package/dist/transforms/migrate-slug-field/index.js +157 -0
- package/dist/transforms/migrate-slug-field/index.js.map +1 -0
- package/dist/transforms/migrate-slug-field/index.spec.d.ts +2 -0
- package/dist/transforms/migrate-slug-field/index.spec.d.ts.map +1 -0
- package/dist/transforms/migrate-slug-field/index.spec.js +47 -0
- package/dist/transforms/migrate-slug-field/index.spec.js.map +1 -0
- package/dist/transforms/migrate-slug-field/no-match.input.js +11 -0
- package/dist/transforms/migrate-slug-field/no-match.input.js.map +1 -0
- package/dist/transforms/migrate-slug-field/no-match.output.js +11 -0
- package/dist/transforms/migrate-slug-field/no-match.output.js.map +1 -0
- package/dist/transforms/migrate-slug-field/overrides.input.js +15 -0
- package/dist/transforms/migrate-slug-field/overrides.input.js.map +1 -0
- package/dist/transforms/migrate-slug-field/overrides.output.js +15 -0
- package/dist/transforms/migrate-slug-field/overrides.output.js.map +1 -0
- package/dist/transforms/migrate-storage-adapters-to-config/basic.input.js +22 -0
- package/dist/transforms/migrate-storage-adapters-to-config/basic.input.js.map +1 -0
- package/dist/transforms/migrate-storage-adapters-to-config/basic.output.js +22 -0
- package/dist/transforms/migrate-storage-adapters-to-config/basic.output.js.map +1 -0
- package/dist/transforms/migrate-storage-adapters-to-config/index.d.ts +3 -0
- package/dist/transforms/migrate-storage-adapters-to-config/index.d.ts.map +1 -0
- package/dist/transforms/migrate-storage-adapters-to-config/index.js +80 -0
- package/dist/transforms/migrate-storage-adapters-to-config/index.js.map +1 -0
- package/dist/transforms/migrate-storage-adapters-to-config/index.spec.d.ts +2 -0
- package/dist/transforms/migrate-storage-adapters-to-config/index.spec.d.ts.map +1 -0
- package/dist/transforms/migrate-storage-adapters-to-config/index.spec.js +85 -0
- package/dist/transforms/migrate-storage-adapters-to-config/index.spec.js.map +1 -0
- package/dist/transforms/migrate-storage-adapters-to-config/mixed-plugins.input.js +24 -0
- package/dist/transforms/migrate-storage-adapters-to-config/mixed-plugins.input.js.map +1 -0
- package/dist/transforms/migrate-storage-adapters-to-config/mixed-plugins.output.js +26 -0
- package/dist/transforms/migrate-storage-adapters-to-config/mixed-plugins.output.js.map +1 -0
- package/dist/transforms/migrate-storage-adapters-to-config/no-match.input.js +14 -0
- package/dist/transforms/migrate-storage-adapters-to-config/no-match.input.js.map +1 -0
- package/dist/transforms/migrate-storage-adapters-to-config/no-match.output.js +14 -0
- package/dist/transforms/migrate-storage-adapters-to-config/no-match.output.js.map +1 -0
- package/dist/transforms/migrate-versions-default/already-set.input.js +16 -0
- package/dist/transforms/migrate-versions-default/already-set.input.js.map +1 -0
- package/dist/transforms/migrate-versions-default/already-set.output.js +16 -0
- package/dist/transforms/migrate-versions-default/already-set.output.js.map +1 -0
- package/dist/transforms/migrate-versions-default/basic.input.js +16 -0
- package/dist/transforms/migrate-versions-default/basic.input.js.map +1 -0
- package/dist/transforms/migrate-versions-default/basic.output.js +18 -0
- package/dist/transforms/migrate-versions-default/basic.output.js.map +1 -0
- package/dist/transforms/migrate-versions-default/globals.input.js +16 -0
- package/dist/transforms/migrate-versions-default/globals.input.js.map +1 -0
- package/dist/transforms/migrate-versions-default/globals.output.js +17 -0
- package/dist/transforms/migrate-versions-default/globals.output.js.map +1 -0
- package/dist/transforms/migrate-versions-default/index.d.ts +10 -0
- package/dist/transforms/migrate-versions-default/index.d.ts.map +1 -0
- package/dist/transforms/migrate-versions-default/index.js +106 -0
- package/dist/transforms/migrate-versions-default/index.js.map +1 -0
- package/dist/transforms/migrate-versions-default/index.test.d.ts +2 -0
- package/dist/transforms/migrate-versions-default/index.test.d.ts.map +1 -0
- package/dist/transforms/migrate-versions-default/index.test.js +81 -0
- package/dist/transforms/migrate-versions-default/index.test.js.map +1 -0
- package/dist/transforms/migrate-versions-default/non-matching.input.js +10 -0
- package/dist/transforms/migrate-versions-default/non-matching.input.js.map +1 -0
- package/dist/transforms/migrate-versions-default/non-matching.output.js +10 -0
- package/dist/transforms/migrate-versions-default/non-matching.output.js.map +1 -0
- package/dist/transforms/migrate-versions-default/satisfies.input.js +11 -0
- package/dist/transforms/migrate-versions-default/satisfies.input.js.map +1 -0
- package/dist/transforms/migrate-versions-default/satisfies.output.js +13 -0
- package/dist/transforms/migrate-versions-default/satisfies.output.js.map +1 -0
- package/dist/transforms/remove-group-by-true/basic.input.js +22 -0
- package/dist/transforms/remove-group-by-true/basic.input.js.map +1 -0
- package/dist/transforms/remove-group-by-true/basic.output.js +19 -0
- package/dist/transforms/remove-group-by-true/basic.output.js.map +1 -0
- package/dist/transforms/remove-group-by-true/index.d.ts +3 -0
- package/dist/transforms/remove-group-by-true/index.d.ts.map +1 -0
- package/dist/transforms/remove-group-by-true/index.js +36 -0
- package/dist/transforms/remove-group-by-true/index.js.map +1 -0
- package/dist/transforms/remove-group-by-true/index.spec.d.ts +2 -0
- package/dist/transforms/remove-group-by-true/index.spec.d.ts.map +1 -0
- package/dist/transforms/remove-group-by-true/index.spec.js +47 -0
- package/dist/transforms/remove-group-by-true/index.spec.js.map +1 -0
- package/dist/transforms/remove-group-by-true/no-match.input.js +13 -0
- package/dist/transforms/remove-group-by-true/no-match.input.js.map +1 -0
- package/dist/transforms/remove-group-by-true/no-match.output.js +13 -0
- package/dist/transforms/remove-group-by-true/no-match.output.js.map +1 -0
- package/dist/transforms/remove-group-by-true/non-boolean.input.js +15 -0
- package/dist/transforms/remove-group-by-true/non-boolean.input.js.map +1 -0
- package/dist/transforms/remove-group-by-true/non-boolean.output.js +15 -0
- package/dist/transforms/remove-group-by-true/non-boolean.output.js.map +1 -0
- package/dist/transforms/remove-localize-status-config/basic.input.js +27 -0
- package/dist/transforms/remove-localize-status-config/basic.input.js.map +1 -0
- package/dist/transforms/remove-localize-status-config/basic.output.js +23 -0
- package/dist/transforms/remove-localize-status-config/basic.output.js.map +1 -0
- package/dist/transforms/remove-localize-status-config/index.d.ts +11 -0
- package/dist/transforms/remove-localize-status-config/index.d.ts.map +1 -0
- package/dist/transforms/remove-localize-status-config/index.js +34 -0
- package/dist/transforms/remove-localize-status-config/index.js.map +1 -0
- package/dist/transforms/remove-localize-status-config/index.spec.d.ts +2 -0
- package/dist/transforms/remove-localize-status-config/index.spec.d.ts.map +1 -0
- package/dist/transforms/remove-localize-status-config/index.spec.js +38 -0
- package/dist/transforms/remove-localize-status-config/index.spec.js.map +1 -0
- package/dist/transforms/remove-localize-status-config/preserve-false.input.js +23 -0
- package/dist/transforms/remove-localize-status-config/preserve-false.input.js.map +1 -0
- package/dist/transforms/remove-localize-status-config/preserve-false.output.js +23 -0
- package/dist/transforms/remove-localize-status-config/preserve-false.output.js.map +1 -0
- package/dist/transforms/remove-publish-specific-locale/already-has-locale.input.js +12 -0
- package/dist/transforms/remove-publish-specific-locale/already-has-locale.input.js.map +1 -0
- package/dist/transforms/remove-publish-specific-locale/already-has-locale.output.js +11 -0
- package/dist/transforms/remove-publish-specific-locale/already-has-locale.output.js.map +1 -0
- package/dist/transforms/remove-publish-specific-locale/basic.input.js +20 -0
- package/dist/transforms/remove-publish-specific-locale/basic.input.js.map +1 -0
- package/dist/transforms/remove-publish-specific-locale/basic.output.js +20 -0
- package/dist/transforms/remove-publish-specific-locale/basic.output.js.map +1 -0
- package/dist/transforms/remove-publish-specific-locale/index.d.ts +11 -0
- package/dist/transforms/remove-publish-specific-locale/index.d.ts.map +1 -0
- package/dist/transforms/remove-publish-specific-locale/index.js +76 -0
- package/dist/transforms/remove-publish-specific-locale/index.js.map +1 -0
- package/dist/transforms/remove-publish-specific-locale/index.spec.d.ts +2 -0
- package/dist/transforms/remove-publish-specific-locale/index.spec.d.ts.map +1 -0
- package/dist/transforms/remove-publish-specific-locale/index.spec.js +47 -0
- package/dist/transforms/remove-publish-specific-locale/index.spec.js.map +1 -0
- package/dist/transforms/remove-publish-specific-locale/non-matching.input.js +6 -0
- package/dist/transforms/remove-publish-specific-locale/non-matching.input.js.map +1 -0
- package/dist/transforms/remove-publish-specific-locale/non-matching.output.js +6 -0
- package/dist/transforms/remove-publish-specific-locale/non-matching.output.js.map +1 -0
- package/dist/transforms/remove-versions-true/basic.input.js +12 -0
- package/dist/transforms/remove-versions-true/basic.input.js.map +1 -0
- package/dist/transforms/remove-versions-true/basic.output.js +10 -0
- package/dist/transforms/remove-versions-true/basic.output.js.map +1 -0
- package/dist/transforms/remove-versions-true/index.d.ts +12 -0
- package/dist/transforms/remove-versions-true/index.d.ts.map +1 -0
- package/dist/transforms/remove-versions-true/index.js +100 -0
- package/dist/transforms/remove-versions-true/index.js.map +1 -0
- package/dist/transforms/remove-versions-true/index.test.d.ts +2 -0
- package/dist/transforms/remove-versions-true/index.test.d.ts.map +1 -0
- package/dist/transforms/remove-versions-true/index.test.js +38 -0
- package/dist/transforms/remove-versions-true/index.test.js.map +1 -0
- package/dist/transforms/remove-versions-true/non-matching.input.js +20 -0
- package/dist/transforms/remove-versions-true/non-matching.input.js.map +1 -0
- package/dist/transforms/remove-versions-true/non-matching.output.js +20 -0
- package/dist/transforms/remove-versions-true/non-matching.output.js.map +1 -0
- package/dist/transforms/rename-storage-adapters-to-storage/basic.input.js +18 -0
- package/dist/transforms/rename-storage-adapters-to-storage/basic.input.js.map +1 -0
- package/dist/transforms/rename-storage-adapters-to-storage/basic.output.js +18 -0
- package/dist/transforms/rename-storage-adapters-to-storage/basic.output.js.map +1 -0
- package/dist/transforms/rename-storage-adapters-to-storage/index.d.ts +3 -0
- package/dist/transforms/rename-storage-adapters-to-storage/index.d.ts.map +1 -0
- package/dist/transforms/rename-storage-adapters-to-storage/index.js +31 -0
- package/dist/transforms/rename-storage-adapters-to-storage/index.js.map +1 -0
- package/dist/transforms/rename-storage-adapters-to-storage/index.spec.d.ts +2 -0
- package/dist/transforms/rename-storage-adapters-to-storage/index.spec.d.ts.map +1 -0
- package/dist/transforms/rename-storage-adapters-to-storage/index.spec.js +55 -0
- package/dist/transforms/rename-storage-adapters-to-storage/index.spec.js.map +1 -0
- package/dist/transforms/rename-storage-adapters-to-storage/no-match.input.js +7 -0
- package/dist/transforms/rename-storage-adapters-to-storage/no-match.input.js.map +1 -0
- package/dist/transforms/rename-storage-adapters-to-storage/no-match.output.js +7 -0
- package/dist/transforms/rename-storage-adapters-to-storage/no-match.output.js.map +1 -0
- package/dist/transforms/rename-typescript-schema-to-json-schema/basic.input.js +25 -0
- package/dist/transforms/rename-typescript-schema-to-json-schema/basic.input.js.map +1 -0
- package/dist/transforms/rename-typescript-schema-to-json-schema/basic.output.js +25 -0
- package/dist/transforms/rename-typescript-schema-to-json-schema/basic.output.js.map +1 -0
- package/dist/transforms/rename-typescript-schema-to-json-schema/index.d.ts +3 -0
- package/dist/transforms/rename-typescript-schema-to-json-schema/index.d.ts.map +1 -0
- package/dist/transforms/rename-typescript-schema-to-json-schema/index.js +54 -0
- package/dist/transforms/rename-typescript-schema-to-json-schema/index.js.map +1 -0
- package/dist/transforms/rename-typescript-schema-to-json-schema/index.spec.d.ts +2 -0
- package/dist/transforms/rename-typescript-schema-to-json-schema/index.spec.d.ts.map +1 -0
- package/dist/transforms/rename-typescript-schema-to-json-schema/index.spec.js +45 -0
- package/dist/transforms/rename-typescript-schema-to-json-schema/index.spec.js.map +1 -0
- package/dist/transforms/rename-typescript-schema-to-json-schema/non-matching.input.js +12 -0
- package/dist/transforms/rename-typescript-schema-to-json-schema/non-matching.input.js.map +1 -0
- package/dist/transforms/rename-typescript-schema-to-json-schema/sibling.input.js +18 -0
- package/dist/transforms/rename-typescript-schema-to-json-schema/sibling.input.js.map +1 -0
- package/dist/types.d.ts +22 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/packageJson.d.ts +17 -0
- package/dist/utils/packageJson.d.ts.map +1 -0
- package/dist/utils/packageJson.js +46 -0
- package/dist/utils/packageJson.js.map +1 -0
- package/dist/utils/packageJson.spec.d.ts +2 -0
- package/dist/utils/packageJson.spec.d.ts.map +1 -0
- package/dist/utils/packageJson.spec.js +41 -0
- package/dist/utils/packageJson.spec.js.map +1 -0
- package/dist/utils/test-helpers.d.ts +23 -0
- package/dist/utils/test-helpers.d.ts.map +1 -0
- package/dist/utils/test-helpers.js +53 -0
- package/dist/utils/test-helpers.js.map +1 -0
- package/package.json +53 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
import { dirname, join } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { describe, expect, it } from 'vitest';
|
|
5
|
+
import { runTransformOnPackageJson } from '../../utils/test-helpers.js';
|
|
6
|
+
import { migrateBuildScript } from './index.js';
|
|
7
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
const fixture = (name)=>readFile(join(here, name), 'utf8');
|
|
9
|
+
describe('migrate-build-script', ()=>{
|
|
10
|
+
it('rewrites a plain next build script', async ()=>{
|
|
11
|
+
const input = await fixture('basic.input.json');
|
|
12
|
+
const output = await fixture('basic.output.json');
|
|
13
|
+
const result = await runTransformOnPackageJson({
|
|
14
|
+
source: input,
|
|
15
|
+
transform: migrateBuildScript
|
|
16
|
+
});
|
|
17
|
+
expect(result).toBe(output);
|
|
18
|
+
});
|
|
19
|
+
it('rewrites a cross-env-prefixed build script', async ()=>{
|
|
20
|
+
const input = await fixture('cross-env.input.json');
|
|
21
|
+
const output = await fixture('cross-env.output.json');
|
|
22
|
+
const result = await runTransformOnPackageJson({
|
|
23
|
+
source: input,
|
|
24
|
+
transform: migrateBuildScript
|
|
25
|
+
});
|
|
26
|
+
expect(result).toBe(output);
|
|
27
|
+
});
|
|
28
|
+
it('rewrites only the next build segment of a compound build script', async ()=>{
|
|
29
|
+
const input = await fixture('tsc-suffix.input.json');
|
|
30
|
+
const output = await fixture('tsc-suffix.output.json');
|
|
31
|
+
const result = await runTransformOnPackageJson({
|
|
32
|
+
source: input,
|
|
33
|
+
transform: migrateBuildScript
|
|
34
|
+
});
|
|
35
|
+
expect(result).toBe(output);
|
|
36
|
+
});
|
|
37
|
+
it('preserves forwarded flags like --turbopack', async ()=>{
|
|
38
|
+
const input = await fixture('turbopack.input.json');
|
|
39
|
+
const output = await fixture('turbopack.output.json');
|
|
40
|
+
const result = await runTransformOnPackageJson({
|
|
41
|
+
source: input,
|
|
42
|
+
transform: migrateBuildScript
|
|
43
|
+
});
|
|
44
|
+
expect(result).toBe(output);
|
|
45
|
+
});
|
|
46
|
+
it('does not rewrite next build inside another word like my-next build', async ()=>{
|
|
47
|
+
const input = '{\n "scripts": {\n "build": "my-next build"\n }\n}\n';
|
|
48
|
+
const result = await runTransformOnPackageJson({
|
|
49
|
+
source: input,
|
|
50
|
+
transform: migrateBuildScript
|
|
51
|
+
});
|
|
52
|
+
expect(result).toBe(input);
|
|
53
|
+
});
|
|
54
|
+
it('is idempotent', async ()=>{
|
|
55
|
+
const output = await fixture('basic.output.json');
|
|
56
|
+
const result = await runTransformOnPackageJson({
|
|
57
|
+
source: output,
|
|
58
|
+
transform: migrateBuildScript
|
|
59
|
+
});
|
|
60
|
+
expect(result).toBe(output);
|
|
61
|
+
});
|
|
62
|
+
it('no-ops on next build-storybook and unrelated scripts', async ()=>{
|
|
63
|
+
const input = await fixture('no-match.input.json');
|
|
64
|
+
const output = await fixture('no-match.output.json');
|
|
65
|
+
const result = await runTransformOnPackageJson({
|
|
66
|
+
source: input,
|
|
67
|
+
transform: migrateBuildScript
|
|
68
|
+
});
|
|
69
|
+
expect(result).toBe(output);
|
|
70
|
+
});
|
|
71
|
+
it('no-ops when there is no build script', async ()=>{
|
|
72
|
+
const input = '{\n "scripts": {\n "dev": "next dev"\n }\n}\n';
|
|
73
|
+
const result = await runTransformOnPackageJson({
|
|
74
|
+
source: input,
|
|
75
|
+
transform: migrateBuildScript
|
|
76
|
+
});
|
|
77
|
+
expect(result).toBe(input);
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
//# sourceMappingURL=index.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/transforms/migrate-build-script/index.spec.ts"],"sourcesContent":["import { readFile } from 'node:fs/promises'\nimport { dirname, join } from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport { describe, expect, it } from 'vitest'\n\nimport { runTransformOnPackageJson } from '../../utils/test-helpers.js'\nimport { migrateBuildScript } from './index.js'\n\nconst here = dirname(fileURLToPath(import.meta.url))\nconst fixture = (name: string) => readFile(join(here, name), 'utf8')\n\ndescribe('migrate-build-script', () => {\n it('rewrites a plain next build script', async () => {\n const input = await fixture('basic.input.json')\n const output = await fixture('basic.output.json')\n\n const result = await runTransformOnPackageJson({ source: input, transform: migrateBuildScript })\n\n expect(result).toBe(output)\n })\n\n it('rewrites a cross-env-prefixed build script', async () => {\n const input = await fixture('cross-env.input.json')\n const output = await fixture('cross-env.output.json')\n\n const result = await runTransformOnPackageJson({ source: input, transform: migrateBuildScript })\n\n expect(result).toBe(output)\n })\n\n it('rewrites only the next build segment of a compound build script', async () => {\n const input = await fixture('tsc-suffix.input.json')\n const output = await fixture('tsc-suffix.output.json')\n\n const result = await runTransformOnPackageJson({ source: input, transform: migrateBuildScript })\n\n expect(result).toBe(output)\n })\n\n it('preserves forwarded flags like --turbopack', async () => {\n const input = await fixture('turbopack.input.json')\n const output = await fixture('turbopack.output.json')\n\n const result = await runTransformOnPackageJson({ source: input, transform: migrateBuildScript })\n\n expect(result).toBe(output)\n })\n\n it('does not rewrite next build inside another word like my-next build', async () => {\n const input = '{\\n \"scripts\": {\\n \"build\": \"my-next build\"\\n }\\n}\\n'\n\n const result = await runTransformOnPackageJson({ source: input, transform: migrateBuildScript })\n\n expect(result).toBe(input)\n })\n\n it('is idempotent', async () => {\n const output = await fixture('basic.output.json')\n\n const result = await runTransformOnPackageJson({\n source: output,\n transform: migrateBuildScript,\n })\n\n expect(result).toBe(output)\n })\n\n it('no-ops on next build-storybook and unrelated scripts', async () => {\n const input = await fixture('no-match.input.json')\n const output = await fixture('no-match.output.json')\n\n const result = await runTransformOnPackageJson({ source: input, transform: migrateBuildScript })\n\n expect(result).toBe(output)\n })\n\n it('no-ops when there is no build script', async () => {\n const input = '{\\n \"scripts\": {\\n \"dev\": \"next dev\"\\n }\\n}\\n'\n\n const result = await runTransformOnPackageJson({ source: input, transform: migrateBuildScript })\n\n expect(result).toBe(input)\n })\n})\n"],"names":["readFile","dirname","join","fileURLToPath","describe","expect","it","runTransformOnPackageJson","migrateBuildScript","here","url","fixture","name","input","output","result","source","transform","toBe"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,mBAAkB;AAC3C,SAASC,OAAO,EAAEC,IAAI,QAAQ,YAAW;AACzC,SAASC,aAAa,QAAQ,WAAU;AACxC,SAASC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,SAAQ;AAE7C,SAASC,yBAAyB,QAAQ,8BAA6B;AACvE,SAASC,kBAAkB,QAAQ,aAAY;AAE/C,MAAMC,OAAOR,QAAQE,cAAc,YAAYO,GAAG;AAClD,MAAMC,UAAU,CAACC,OAAiBZ,SAASE,KAAKO,MAAMG,OAAO;AAE7DR,SAAS,wBAAwB;IAC/BE,GAAG,sCAAsC;QACvC,MAAMO,QAAQ,MAAMF,QAAQ;QAC5B,MAAMG,SAAS,MAAMH,QAAQ;QAE7B,MAAMI,SAAS,MAAMR,0BAA0B;YAAES,QAAQH;YAAOI,WAAWT;QAAmB;QAE9FH,OAAOU,QAAQG,IAAI,CAACJ;IACtB;IAEAR,GAAG,8CAA8C;QAC/C,MAAMO,QAAQ,MAAMF,QAAQ;QAC5B,MAAMG,SAAS,MAAMH,QAAQ;QAE7B,MAAMI,SAAS,MAAMR,0BAA0B;YAAES,QAAQH;YAAOI,WAAWT;QAAmB;QAE9FH,OAAOU,QAAQG,IAAI,CAACJ;IACtB;IAEAR,GAAG,mEAAmE;QACpE,MAAMO,QAAQ,MAAMF,QAAQ;QAC5B,MAAMG,SAAS,MAAMH,QAAQ;QAE7B,MAAMI,SAAS,MAAMR,0BAA0B;YAAES,QAAQH;YAAOI,WAAWT;QAAmB;QAE9FH,OAAOU,QAAQG,IAAI,CAACJ;IACtB;IAEAR,GAAG,8CAA8C;QAC/C,MAAMO,QAAQ,MAAMF,QAAQ;QAC5B,MAAMG,SAAS,MAAMH,QAAQ;QAE7B,MAAMI,SAAS,MAAMR,0BAA0B;YAAES,QAAQH;YAAOI,WAAWT;QAAmB;QAE9FH,OAAOU,QAAQG,IAAI,CAACJ;IACtB;IAEAR,GAAG,sEAAsE;QACvE,MAAMO,QAAQ;QAEd,MAAME,SAAS,MAAMR,0BAA0B;YAAES,QAAQH;YAAOI,WAAWT;QAAmB;QAE9FH,OAAOU,QAAQG,IAAI,CAACL;IACtB;IAEAP,GAAG,iBAAiB;QAClB,MAAMQ,SAAS,MAAMH,QAAQ;QAE7B,MAAMI,SAAS,MAAMR,0BAA0B;YAC7CS,QAAQF;YACRG,WAAWT;QACb;QAEAH,OAAOU,QAAQG,IAAI,CAACJ;IACtB;IAEAR,GAAG,wDAAwD;QACzD,MAAMO,QAAQ,MAAMF,QAAQ;QAC5B,MAAMG,SAAS,MAAMH,QAAQ;QAE7B,MAAMI,SAAS,MAAMR,0BAA0B;YAAES,QAAQH;YAAOI,WAAWT;QAAmB;QAE9FH,OAAOU,QAAQG,IAAI,CAACJ;IACtB;IAEAR,GAAG,wCAAwC;QACzC,MAAMO,QAAQ;QAEd,MAAME,SAAS,MAAMR,0BAA0B;YAAES,QAAQH;YAAOI,WAAWT;QAAmB;QAE9FH,OAAOU,QAAQG,IAAI,CAACL;IACtB;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/transforms/migrate-db-types-subpath/basic.input.ts"],"sourcesContent":["import type { BuildQueryJoinAliases, DrizzleAdapter } from '@payloadcms/drizzle/types'\nimport type { PostgresAdapter } from '@payloadcms/db-postgres/types'\nimport type { SQLiteAdapter } from '@payloadcms/db-sqlite/types'\nimport type { VercelPostgresAdapter } from '@payloadcms/db-vercel-postgres/types'\nimport type { SQLiteD1Adapter } from '@payloadcms/db-d1-sqlite/types'\n\nexport type MyAdapter = DrizzleAdapter\nexport type MyPostgresAdapter = PostgresAdapter\nexport type MySQLiteAdapter = SQLiteAdapter\n"],"names":[],"mappings":"AAQA,WAA2C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/transforms/migrate-db-types-subpath/basic.output.ts"],"sourcesContent":["import type { BuildQueryJoinAliases, DrizzleAdapter } from '@payloadcms/drizzle'\nimport type { PostgresAdapter } from '@payloadcms/db-postgres'\nimport type { SQLiteAdapter } from '@payloadcms/db-sqlite'\nimport type { VercelPostgresAdapter } from '@payloadcms/db-vercel-postgres'\nimport type { SQLiteD1Adapter } from '@payloadcms/db-d1-sqlite'\n\nexport type MyAdapter = DrizzleAdapter\nexport type MyPostgresAdapter = PostgresAdapter\nexport type MySQLiteAdapter = SQLiteAdapter\n"],"names":[],"mappings":"AAQA,WAA2C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/transforms/migrate-db-types-subpath/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAU/C,eAAO,MAAM,qBAAqB,EAAE,SAiDnC,CAAA"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
const SUBPATH_TO_MAIN = {
|
|
2
|
+
'@payloadcms/db-d1-sqlite/types': '@payloadcms/db-d1-sqlite',
|
|
3
|
+
'@payloadcms/db-postgres/types': '@payloadcms/db-postgres',
|
|
4
|
+
'@payloadcms/db-sqlite/types': '@payloadcms/db-sqlite',
|
|
5
|
+
'@payloadcms/db-vercel-postgres/types': '@payloadcms/db-vercel-postgres',
|
|
6
|
+
'@payloadcms/drizzle/types': '@payloadcms/drizzle'
|
|
7
|
+
};
|
|
8
|
+
export const migrateDbTypesSubpath = {
|
|
9
|
+
name: 'migrate-db-types-subpath',
|
|
10
|
+
apply: ({ project })=>{
|
|
11
|
+
const filesChanged = new Set();
|
|
12
|
+
for (const file of project.getSourceFiles()){
|
|
13
|
+
let mutated = false;
|
|
14
|
+
for (const importDecl of file.getImportDeclarations()){
|
|
15
|
+
const specifier = importDecl.getModuleSpecifierValue();
|
|
16
|
+
const main = SUBPATH_TO_MAIN[specifier];
|
|
17
|
+
if (main) {
|
|
18
|
+
importDecl.setModuleSpecifier(main);
|
|
19
|
+
mutated = true;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
for (const exportDecl of file.getExportDeclarations()){
|
|
23
|
+
const specifier = exportDecl.getModuleSpecifierValue();
|
|
24
|
+
if (specifier) {
|
|
25
|
+
const main = SUBPATH_TO_MAIN[specifier];
|
|
26
|
+
if (main) {
|
|
27
|
+
exportDecl.setModuleSpecifier(main);
|
|
28
|
+
mutated = true;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
// Handle `declare module '@payloadcms/.../types' { }` augmentations.
|
|
33
|
+
// getName() on an ambient module declaration includes the surrounding quotes.
|
|
34
|
+
for (const moduleDecl of file.getModules()){
|
|
35
|
+
const rawName = moduleDecl.getName();
|
|
36
|
+
const specifier = rawName.replace(/^['"`]|['"`]$/g, '');
|
|
37
|
+
const main = SUBPATH_TO_MAIN[specifier];
|
|
38
|
+
if (main) {
|
|
39
|
+
moduleDecl.getNameNode().replaceWithText(`'${main}'`);
|
|
40
|
+
mutated = true;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (mutated) {
|
|
44
|
+
filesChanged.add(file.getFilePath());
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
filesChanged: [
|
|
49
|
+
...filesChanged
|
|
50
|
+
]
|
|
51
|
+
};
|
|
52
|
+
},
|
|
53
|
+
description: 'Rewrites imports from the removed `/types` subpath exports of `@payloadcms/drizzle` and database adapter packages to their main entry point. Also handles re-export declarations and `declare module` augmentations for the same paths.'
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/transforms/migrate-db-types-subpath/index.ts"],"sourcesContent":["import type { Transform } from '../../types.js'\n\nconst SUBPATH_TO_MAIN: Record<string, string> = {\n '@payloadcms/db-d1-sqlite/types': '@payloadcms/db-d1-sqlite',\n '@payloadcms/db-postgres/types': '@payloadcms/db-postgres',\n '@payloadcms/db-sqlite/types': '@payloadcms/db-sqlite',\n '@payloadcms/db-vercel-postgres/types': '@payloadcms/db-vercel-postgres',\n '@payloadcms/drizzle/types': '@payloadcms/drizzle',\n}\n\nexport const migrateDbTypesSubpath: Transform = {\n name: 'migrate-db-types-subpath',\n apply: ({ project }) => {\n const filesChanged = new Set<string>()\n\n for (const file of project.getSourceFiles()) {\n let mutated = false\n\n for (const importDecl of file.getImportDeclarations()) {\n const specifier = importDecl.getModuleSpecifierValue()\n const main = SUBPATH_TO_MAIN[specifier]\n if (main) {\n importDecl.setModuleSpecifier(main)\n mutated = true\n }\n }\n\n for (const exportDecl of file.getExportDeclarations()) {\n const specifier = exportDecl.getModuleSpecifierValue()\n if (specifier) {\n const main = SUBPATH_TO_MAIN[specifier]\n if (main) {\n exportDecl.setModuleSpecifier(main)\n mutated = true\n }\n }\n }\n\n // Handle `declare module '@payloadcms/.../types' { }` augmentations.\n // getName() on an ambient module declaration includes the surrounding quotes.\n for (const moduleDecl of file.getModules()) {\n const rawName = moduleDecl.getName()\n const specifier = rawName.replace(/^['\"`]|['\"`]$/g, '')\n const main = SUBPATH_TO_MAIN[specifier]\n if (main) {\n moduleDecl.getNameNode().replaceWithText(`'${main}'`)\n mutated = true\n }\n }\n\n if (mutated) {\n filesChanged.add(file.getFilePath())\n }\n }\n\n return { filesChanged: [...filesChanged] }\n },\n description:\n 'Rewrites imports from the removed `/types` subpath exports of `@payloadcms/drizzle` and database adapter packages to their main entry point. Also handles re-export declarations and `declare module` augmentations for the same paths.',\n}\n"],"names":["SUBPATH_TO_MAIN","migrateDbTypesSubpath","name","apply","project","filesChanged","Set","file","getSourceFiles","mutated","importDecl","getImportDeclarations","specifier","getModuleSpecifierValue","main","setModuleSpecifier","exportDecl","getExportDeclarations","moduleDecl","getModules","rawName","getName","replace","getNameNode","replaceWithText","add","getFilePath","description"],"mappings":"AAEA,MAAMA,kBAA0C;IAC9C,kCAAkC;IAClC,iCAAiC;IACjC,+BAA+B;IAC/B,wCAAwC;IACxC,6BAA6B;AAC/B;AAEA,OAAO,MAAMC,wBAAmC;IAC9CC,MAAM;IACNC,OAAO,CAAC,EAAEC,OAAO,EAAE;QACjB,MAAMC,eAAe,IAAIC;QAEzB,KAAK,MAAMC,QAAQH,QAAQI,cAAc,GAAI;YAC3C,IAAIC,UAAU;YAEd,KAAK,MAAMC,cAAcH,KAAKI,qBAAqB,GAAI;gBACrD,MAAMC,YAAYF,WAAWG,uBAAuB;gBACpD,MAAMC,OAAOd,eAAe,CAACY,UAAU;gBACvC,IAAIE,MAAM;oBACRJ,WAAWK,kBAAkB,CAACD;oBAC9BL,UAAU;gBACZ;YACF;YAEA,KAAK,MAAMO,cAAcT,KAAKU,qBAAqB,GAAI;gBACrD,MAAML,YAAYI,WAAWH,uBAAuB;gBACpD,IAAID,WAAW;oBACb,MAAME,OAAOd,eAAe,CAACY,UAAU;oBACvC,IAAIE,MAAM;wBACRE,WAAWD,kBAAkB,CAACD;wBAC9BL,UAAU;oBACZ;gBACF;YACF;YAEA,qEAAqE;YACrE,8EAA8E;YAC9E,KAAK,MAAMS,cAAcX,KAAKY,UAAU,GAAI;gBAC1C,MAAMC,UAAUF,WAAWG,OAAO;gBAClC,MAAMT,YAAYQ,QAAQE,OAAO,CAAC,kBAAkB;gBACpD,MAAMR,OAAOd,eAAe,CAACY,UAAU;gBACvC,IAAIE,MAAM;oBACRI,WAAWK,WAAW,GAAGC,eAAe,CAAC,CAAC,CAAC,EAAEV,KAAK,CAAC,CAAC;oBACpDL,UAAU;gBACZ;YACF;YAEA,IAAIA,SAAS;gBACXJ,aAAaoB,GAAG,CAAClB,KAAKmB,WAAW;YACnC;QACF;QAEA,OAAO;YAAErB,cAAc;mBAAIA;aAAa;QAAC;IAC3C;IACAsB,aACE;AACJ,EAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.spec.d.ts","sourceRoot":"","sources":["../../../src/transforms/migrate-db-types-subpath/index.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
import { dirname, join } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { describe, expect, it } from 'vitest';
|
|
5
|
+
import { runTransform } from '../../utils/test-helpers.js';
|
|
6
|
+
import { migrateDbTypesSubpath } from './index.js';
|
|
7
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
const fixture = (name)=>readFile(join(here, name), 'utf8');
|
|
9
|
+
describe('migrate-db-types-subpath', ()=>{
|
|
10
|
+
it('rewrites /types subpath imports to the main package entry point', async ()=>{
|
|
11
|
+
const input = await fixture('basic.input.ts');
|
|
12
|
+
const output = await fixture('basic.output.ts');
|
|
13
|
+
const result = await runTransform({
|
|
14
|
+
source: input,
|
|
15
|
+
transform: migrateDbTypesSubpath
|
|
16
|
+
});
|
|
17
|
+
expect(result).toBe(output);
|
|
18
|
+
});
|
|
19
|
+
it('rewrites declare module augmentations for /types subpaths', async ()=>{
|
|
20
|
+
const input = await fixture('module-augmentation.input.ts');
|
|
21
|
+
const output = await fixture('module-augmentation.output.ts');
|
|
22
|
+
const result = await runTransform({
|
|
23
|
+
source: input,
|
|
24
|
+
transform: migrateDbTypesSubpath
|
|
25
|
+
});
|
|
26
|
+
expect(result).toBe(output);
|
|
27
|
+
});
|
|
28
|
+
it('is idempotent on already-migrated source', async ()=>{
|
|
29
|
+
const output = await fixture('basic.output.ts');
|
|
30
|
+
const result = await runTransform({
|
|
31
|
+
source: output,
|
|
32
|
+
transform: migrateDbTypesSubpath
|
|
33
|
+
});
|
|
34
|
+
expect(result).toBe(output);
|
|
35
|
+
});
|
|
36
|
+
it('leaves unrelated imports untouched', async ()=>{
|
|
37
|
+
const input = await fixture('non-matching.input.ts');
|
|
38
|
+
const result = await runTransform({
|
|
39
|
+
source: input,
|
|
40
|
+
transform: migrateDbTypesSubpath
|
|
41
|
+
});
|
|
42
|
+
expect(result).toBe(input);
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
//# sourceMappingURL=index.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/transforms/migrate-db-types-subpath/index.spec.ts"],"sourcesContent":["import { readFile } from 'node:fs/promises'\nimport { dirname, join } from 'node:path'\nimport { fileURLToPath } from 'node:url'\nimport { describe, expect, it } from 'vitest'\n\nimport { runTransform } from '../../utils/test-helpers.js'\nimport { migrateDbTypesSubpath } from './index.js'\n\nconst here = dirname(fileURLToPath(import.meta.url))\nconst fixture = (name: string) => readFile(join(here, name), 'utf8')\n\ndescribe('migrate-db-types-subpath', () => {\n it('rewrites /types subpath imports to the main package entry point', async () => {\n const input = await fixture('basic.input.ts')\n const output = await fixture('basic.output.ts')\n\n const result = await runTransform({ source: input, transform: migrateDbTypesSubpath })\n\n expect(result).toBe(output)\n })\n\n it('rewrites declare module augmentations for /types subpaths', async () => {\n const input = await fixture('module-augmentation.input.ts')\n const output = await fixture('module-augmentation.output.ts')\n\n const result = await runTransform({ source: input, transform: migrateDbTypesSubpath })\n\n expect(result).toBe(output)\n })\n\n it('is idempotent on already-migrated source', async () => {\n const output = await fixture('basic.output.ts')\n\n const result = await runTransform({ source: output, transform: migrateDbTypesSubpath })\n\n expect(result).toBe(output)\n })\n\n it('leaves unrelated imports untouched', async () => {\n const input = await fixture('non-matching.input.ts')\n\n const result = await runTransform({ source: input, transform: migrateDbTypesSubpath })\n\n expect(result).toBe(input)\n })\n})\n"],"names":["readFile","dirname","join","fileURLToPath","describe","expect","it","runTransform","migrateDbTypesSubpath","here","url","fixture","name","input","output","result","source","transform","toBe"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,mBAAkB;AAC3C,SAASC,OAAO,EAAEC,IAAI,QAAQ,YAAW;AACzC,SAASC,aAAa,QAAQ,WAAU;AACxC,SAASC,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ,SAAQ;AAE7C,SAASC,YAAY,QAAQ,8BAA6B;AAC1D,SAASC,qBAAqB,QAAQ,aAAY;AAElD,MAAMC,OAAOR,QAAQE,cAAc,YAAYO,GAAG;AAClD,MAAMC,UAAU,CAACC,OAAiBZ,SAASE,KAAKO,MAAMG,OAAO;AAE7DR,SAAS,4BAA4B;IACnCE,GAAG,mEAAmE;QACpE,MAAMO,QAAQ,MAAMF,QAAQ;QAC5B,MAAMG,SAAS,MAAMH,QAAQ;QAE7B,MAAMI,SAAS,MAAMR,aAAa;YAAES,QAAQH;YAAOI,WAAWT;QAAsB;QAEpFH,OAAOU,QAAQG,IAAI,CAACJ;IACtB;IAEAR,GAAG,6DAA6D;QAC9D,MAAMO,QAAQ,MAAMF,QAAQ;QAC5B,MAAMG,SAAS,MAAMH,QAAQ;QAE7B,MAAMI,SAAS,MAAMR,aAAa;YAAES,QAAQH;YAAOI,WAAWT;QAAsB;QAEpFH,OAAOU,QAAQG,IAAI,CAACJ;IACtB;IAEAR,GAAG,4CAA4C;QAC7C,MAAMQ,SAAS,MAAMH,QAAQ;QAE7B,MAAMI,SAAS,MAAMR,aAAa;YAAES,QAAQF;YAAQG,WAAWT;QAAsB;QAErFH,OAAOU,QAAQG,IAAI,CAACJ;IACtB;IAEAR,GAAG,sCAAsC;QACvC,MAAMO,QAAQ,MAAMF,QAAQ;QAE5B,MAAMI,SAAS,MAAMR,aAAa;YAAES,QAAQH;YAAOI,WAAWT;QAAsB;QAEpFH,OAAOU,QAAQG,IAAI,CAACL;IACtB;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/transforms/migrate-db-types-subpath/module-augmentation.input.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/transforms/migrate-db-types-subpath/module-augmentation.output.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/transforms/migrate-db-types-subpath/non-matching.input.ts"],"sourcesContent":["import type { DrizzleAdapter } from '@payloadcms/drizzle'\nimport type { PostgresAdapter } from '@payloadcms/db-postgres'\nimport type { SQLiteAdapter } from '@payloadcms/db-sqlite'\nimport type { SomeType } from 'some-other-package/types'\n\nexport type MyAdapter = DrizzleAdapter\n"],"names":[],"mappings":"AAKA,WAAsC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export const Posts = {
|
|
2
|
+
slug: 'posts',
|
|
3
|
+
fields: [
|
|
4
|
+
{
|
|
5
|
+
name: 'title',
|
|
6
|
+
type: 'text',
|
|
7
|
+
admin: {
|
|
8
|
+
disableListColumn: true,
|
|
9
|
+
disableListFilter: true
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
name: 'slug',
|
|
14
|
+
type: 'text',
|
|
15
|
+
admin: {
|
|
16
|
+
disableBulkEdit: true,
|
|
17
|
+
disableGroupBy: true
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'normal',
|
|
22
|
+
type: 'text'
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=basic.input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/transforms/migrate-disabled-fields/basic.input.ts"],"sourcesContent":["export const Posts = {\n slug: 'posts',\n fields: [\n {\n name: 'title',\n type: 'text',\n admin: {\n disableListColumn: true,\n disableListFilter: true,\n },\n },\n {\n name: 'slug',\n type: 'text',\n admin: {\n disableBulkEdit: true,\n disableGroupBy: true,\n },\n },\n {\n name: 'normal',\n type: 'text',\n },\n ],\n}\n"],"names":["Posts","slug","fields","name","type","admin","disableListColumn","disableListFilter","disableBulkEdit","disableGroupBy"],"mappings":"AAAA,OAAO,MAAMA,QAAQ;IACnBC,MAAM;IACNC,QAAQ;QACN;YACEC,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,mBAAmB;gBACnBC,mBAAmB;YACrB;QACF;QACA;YACEJ,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLG,iBAAiB;gBACjBC,gBAAgB;YAClB;QACF;QACA;YACEN,MAAM;YACNC,MAAM;QACR;KACD;AACH,EAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export const Posts = {
|
|
2
|
+
slug: 'posts',
|
|
3
|
+
fields: [
|
|
4
|
+
{
|
|
5
|
+
name: 'title',
|
|
6
|
+
type: 'text',
|
|
7
|
+
admin: {
|
|
8
|
+
disabled: {
|
|
9
|
+
column: true,
|
|
10
|
+
filter: true
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: 'slug',
|
|
16
|
+
type: 'text',
|
|
17
|
+
admin: {
|
|
18
|
+
disabled: {
|
|
19
|
+
bulkEdit: true,
|
|
20
|
+
groupBy: true
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: 'normal',
|
|
26
|
+
type: 'text'
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=basic.output.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/transforms/migrate-disabled-fields/basic.output.ts"],"sourcesContent":["export const Posts = {\n slug: 'posts',\n fields: [\n {\n name: 'title',\n type: 'text',\n admin: {\n disabled: { column: true, filter: true },\n },\n },\n {\n name: 'slug',\n type: 'text',\n admin: {\n disabled: { bulkEdit: true, groupBy: true },\n },\n },\n {\n name: 'normal',\n type: 'text',\n },\n ],\n}\n"],"names":["Posts","slug","fields","name","type","admin","disabled","column","filter","bulkEdit","groupBy"],"mappings":"AAAA,OAAO,MAAMA,QAAQ;IACnBC,MAAM;IACNC,QAAQ;QACN;YACEC,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,UAAU;oBAAEC,QAAQ;oBAAMC,QAAQ;gBAAK;YACzC;QACF;QACA;YACEL,MAAM;YACNC,MAAM;YACNC,OAAO;gBACLC,UAAU;oBAAEG,UAAU;oBAAMC,SAAS;gBAAK;YAC5C;QACF;QACA;YACEP,MAAM;YACNC,MAAM;QACR;KACD;AACH,EAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export const Media = {
|
|
2
|
+
slug: 'media',
|
|
3
|
+
upload: {
|
|
4
|
+
imageSizes: [
|
|
5
|
+
{
|
|
6
|
+
name: 'thumbnail',
|
|
7
|
+
width: 300,
|
|
8
|
+
height: 300,
|
|
9
|
+
admin: {
|
|
10
|
+
disableListColumn: true,
|
|
11
|
+
disableListFilter: true,
|
|
12
|
+
disableGroupBy: true
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: 'hero',
|
|
17
|
+
width: 1920,
|
|
18
|
+
height: 1080,
|
|
19
|
+
admin: {
|
|
20
|
+
disableListColumn: true
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'card',
|
|
25
|
+
width: 600,
|
|
26
|
+
height: 400
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=imagesize.input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/transforms/migrate-disabled-fields/imagesize.input.ts"],"sourcesContent":["export const Media = {\n slug: 'media',\n upload: {\n imageSizes: [\n {\n name: 'thumbnail',\n width: 300,\n height: 300,\n admin: {\n disableListColumn: true,\n disableListFilter: true,\n disableGroupBy: true,\n },\n },\n {\n name: 'hero',\n width: 1920,\n height: 1080,\n admin: {\n disableListColumn: true,\n },\n },\n {\n name: 'card',\n width: 600,\n height: 400,\n },\n ],\n },\n}\n"],"names":["Media","slug","upload","imageSizes","name","width","height","admin","disableListColumn","disableListFilter","disableGroupBy"],"mappings":"AAAA,OAAO,MAAMA,QAAQ;IACnBC,MAAM;IACNC,QAAQ;QACNC,YAAY;YACV;gBACEC,MAAM;gBACNC,OAAO;gBACPC,QAAQ;gBACRC,OAAO;oBACLC,mBAAmB;oBACnBC,mBAAmB;oBACnBC,gBAAgB;gBAClB;YACF;YACA;gBACEN,MAAM;gBACNC,OAAO;gBACPC,QAAQ;gBACRC,OAAO;oBACLC,mBAAmB;gBACrB;YACF;YACA;gBACEJ,MAAM;gBACNC,OAAO;gBACPC,QAAQ;YACV;SACD;IACH;AACF,EAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export const Media = {
|
|
2
|
+
slug: 'media',
|
|
3
|
+
upload: {
|
|
4
|
+
imageSizes: [
|
|
5
|
+
{
|
|
6
|
+
name: 'thumbnail',
|
|
7
|
+
width: 300,
|
|
8
|
+
height: 300,
|
|
9
|
+
admin: {
|
|
10
|
+
disabled: {
|
|
11
|
+
column: true,
|
|
12
|
+
filter: true,
|
|
13
|
+
groupBy: true
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: 'hero',
|
|
19
|
+
width: 1920,
|
|
20
|
+
height: 1080,
|
|
21
|
+
admin: {
|
|
22
|
+
disabled: {
|
|
23
|
+
column: true
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: 'card',
|
|
29
|
+
width: 600,
|
|
30
|
+
height: 400
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=imagesize.output.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/transforms/migrate-disabled-fields/imagesize.output.ts"],"sourcesContent":["export const Media = {\n slug: 'media',\n upload: {\n imageSizes: [\n {\n name: 'thumbnail',\n width: 300,\n height: 300,\n admin: {\n disabled: { column: true, filter: true, groupBy: true },\n },\n },\n {\n name: 'hero',\n width: 1920,\n height: 1080,\n admin: {\n disabled: { column: true },\n },\n },\n {\n name: 'card',\n width: 600,\n height: 400,\n },\n ],\n },\n}\n"],"names":["Media","slug","upload","imageSizes","name","width","height","admin","disabled","column","filter","groupBy"],"mappings":"AAAA,OAAO,MAAMA,QAAQ;IACnBC,MAAM;IACNC,QAAQ;QACNC,YAAY;YACV;gBACEC,MAAM;gBACNC,OAAO;gBACPC,QAAQ;gBACRC,OAAO;oBACLC,UAAU;wBAAEC,QAAQ;wBAAMC,QAAQ;wBAAMC,SAAS;oBAAK;gBACxD;YACF;YACA;gBACEP,MAAM;gBACNC,OAAO;gBACPC,QAAQ;gBACRC,OAAO;oBACLC,UAAU;wBAAEC,QAAQ;oBAAK;gBAC3B;YACF;YACA;gBACEL,MAAM;gBACNC,OAAO;gBACPC,QAAQ;YACV;SACD;IACH;AACF,EAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/transforms/migrate-disabled-fields/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAS/C,eAAO,MAAM,qBAAqB,EAAE,SAiHnC,CAAA"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { Node, SyntaxKind } from 'ts-morph';
|
|
2
|
+
const OLD_TO_NEW = {
|
|
3
|
+
disableBulkEdit: 'bulkEdit',
|
|
4
|
+
disableGroupBy: 'groupBy',
|
|
5
|
+
disableListColumn: 'column',
|
|
6
|
+
disableListFilter: 'filter'
|
|
7
|
+
};
|
|
8
|
+
export const migrateDisabledFields = {
|
|
9
|
+
name: 'migrate-disabled-fields',
|
|
10
|
+
apply: ({ project })=>{
|
|
11
|
+
const filesChanged = new Set();
|
|
12
|
+
const notes = [];
|
|
13
|
+
for (const sourceFile of project.getSourceFiles()){
|
|
14
|
+
let mutated = false;
|
|
15
|
+
sourceFile.forEachDescendant((node)=>{
|
|
16
|
+
if (!Node.isPropertyAssignment(node)) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
if (node.getName() !== 'admin') {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const initializer = node.getInitializer();
|
|
23
|
+
if (!initializer || !Node.isObjectLiteralExpression(initializer)) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
// Match field admin objects (parent has `type`) and imageSize admin objects (parent has `name`).
|
|
27
|
+
// Collection-level admin objects have neither, and also never carry the old disable* props.
|
|
28
|
+
const parent = node.getParent();
|
|
29
|
+
if (!parent || !Node.isObjectLiteralExpression(parent)) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
if (!parent.getProperty('type') && !parent.getProperty('name')) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const oldProps = [];
|
|
36
|
+
for (const prop of initializer.getProperties()){
|
|
37
|
+
if (Node.isPropertyAssignment(prop) && prop.getName() in OLD_TO_NEW) {
|
|
38
|
+
oldProps.push(prop);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if (oldProps.length === 0) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const collectedTrueKeys = [];
|
|
45
|
+
let nonLiteralEncountered = false;
|
|
46
|
+
for (const prop of oldProps){
|
|
47
|
+
const init = prop.getInitializer();
|
|
48
|
+
if (init?.getKind() === SyntaxKind.TrueKeyword) {
|
|
49
|
+
collectedTrueKeys.push(OLD_TO_NEW[prop.getName()]);
|
|
50
|
+
} else if (init?.getKind() === SyntaxKind.FalseKeyword) {
|
|
51
|
+
// false → drop; absence in new shape means area is enabled.
|
|
52
|
+
} else {
|
|
53
|
+
nonLiteralEncountered = true;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
if (nonLiteralEncountered) {
|
|
57
|
+
notes.push(`${sourceFile.getFilePath()}: Non-literal disable* value found in admin object — skipped. Migrate manually.`);
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const existingDisabled = initializer.getProperties().find((prop)=>Node.isPropertyAssignment(prop) && prop.getName() === 'disabled');
|
|
61
|
+
for (const prop of oldProps){
|
|
62
|
+
prop.remove();
|
|
63
|
+
}
|
|
64
|
+
if (collectedTrueKeys.length === 0) {
|
|
65
|
+
mutated = true;
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
const sortedKeys = [
|
|
69
|
+
...collectedTrueKeys
|
|
70
|
+
].sort();
|
|
71
|
+
const newProps = sortedKeys.map((key)=>`${key}: true`).join(', ');
|
|
72
|
+
if (!existingDisabled) {
|
|
73
|
+
initializer.addPropertyAssignment({
|
|
74
|
+
name: 'disabled',
|
|
75
|
+
initializer: `{ ${newProps} }`
|
|
76
|
+
});
|
|
77
|
+
} else {
|
|
78
|
+
const existingInit = existingDisabled.getInitializer();
|
|
79
|
+
if (existingInit?.getKind() === SyntaxKind.TrueKeyword) {
|
|
80
|
+
// disabled: true already covers everything — drop new keys.
|
|
81
|
+
} else if (existingInit?.getKind() === SyntaxKind.FalseKeyword) {
|
|
82
|
+
existingDisabled.setInitializer(`{ ${newProps} }`);
|
|
83
|
+
} else if (existingInit && Node.isObjectLiteralExpression(existingInit)) {
|
|
84
|
+
mergeAndSortObject(existingInit, sortedKeys);
|
|
85
|
+
} else {
|
|
86
|
+
notes.push(`${sourceFile.getFilePath()}: existing 'disabled' value is non-literal — merged keys may be incorrect.`);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
mutated = true;
|
|
90
|
+
});
|
|
91
|
+
if (mutated) {
|
|
92
|
+
filesChanged.add(sourceFile.getFilePath());
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return {
|
|
96
|
+
filesChanged: [
|
|
97
|
+
...filesChanged
|
|
98
|
+
],
|
|
99
|
+
notes
|
|
100
|
+
};
|
|
101
|
+
},
|
|
102
|
+
description: 'Migrate field.admin and imageSize.admin disable* props (disableListColumn, disableListFilter, disableGroupBy, disableBulkEdit) into the consolidated disabled object form.'
|
|
103
|
+
};
|
|
104
|
+
const mergeAndSortObject = (existing, newKeys)=>{
|
|
105
|
+
const merged = new Map();
|
|
106
|
+
for (const prop of existing.getProperties()){
|
|
107
|
+
if (Node.isPropertyAssignment(prop)) {
|
|
108
|
+
const init = prop.getInitializer();
|
|
109
|
+
merged.set(prop.getName(), init?.getText() ?? 'true');
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
for (const key of newKeys){
|
|
113
|
+
if (!merged.has(key)) {
|
|
114
|
+
merged.set(key, 'true');
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
const sortedKeys = [
|
|
118
|
+
...merged.keys()
|
|
119
|
+
].sort();
|
|
120
|
+
const inline = sortedKeys.map((key)=>`${key}: ${merged.get(key)}`).join(', ');
|
|
121
|
+
existing.replaceWithText(`{ ${inline} }`);
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/transforms/migrate-disabled-fields/index.ts"],"sourcesContent":["import type { ObjectLiteralExpression, PropertyAssignment } from 'ts-morph'\n\nimport { Node, SyntaxKind } from 'ts-morph'\n\nimport type { Transform } from '../../types.js'\n\nconst OLD_TO_NEW: Record<string, string> = {\n disableBulkEdit: 'bulkEdit',\n disableGroupBy: 'groupBy',\n disableListColumn: 'column',\n disableListFilter: 'filter',\n}\n\nexport const migrateDisabledFields: Transform = {\n name: 'migrate-disabled-fields',\n apply: ({ project }) => {\n const filesChanged = new Set<string>()\n const notes: string[] = []\n\n for (const sourceFile of project.getSourceFiles()) {\n let mutated = false\n\n sourceFile.forEachDescendant((node) => {\n if (!Node.isPropertyAssignment(node)) {\n return\n }\n if (node.getName() !== 'admin') {\n return\n }\n const initializer = node.getInitializer()\n if (!initializer || !Node.isObjectLiteralExpression(initializer)) {\n return\n }\n // Match field admin objects (parent has `type`) and imageSize admin objects (parent has `name`).\n // Collection-level admin objects have neither, and also never carry the old disable* props.\n const parent = node.getParent()\n if (!parent || !Node.isObjectLiteralExpression(parent)) {\n return\n }\n if (!parent.getProperty('type') && !parent.getProperty('name')) {\n return\n }\n\n const oldProps: PropertyAssignment[] = []\n for (const prop of initializer.getProperties()) {\n if (Node.isPropertyAssignment(prop) && prop.getName() in OLD_TO_NEW) {\n oldProps.push(prop)\n }\n }\n\n if (oldProps.length === 0) {\n return\n }\n\n const collectedTrueKeys: string[] = []\n let nonLiteralEncountered = false\n\n for (const prop of oldProps) {\n const init = prop.getInitializer()\n if (init?.getKind() === SyntaxKind.TrueKeyword) {\n collectedTrueKeys.push(OLD_TO_NEW[prop.getName()]!)\n } else if (init?.getKind() === SyntaxKind.FalseKeyword) {\n // false → drop; absence in new shape means area is enabled.\n } else {\n nonLiteralEncountered = true\n }\n }\n\n if (nonLiteralEncountered) {\n notes.push(\n `${sourceFile.getFilePath()}: Non-literal disable* value found in admin object — skipped. Migrate manually.`,\n )\n return\n }\n\n const existingDisabled = initializer\n .getProperties()\n .find(\n (prop): prop is PropertyAssignment =>\n Node.isPropertyAssignment(prop) && prop.getName() === 'disabled',\n )\n\n for (const prop of oldProps) {\n prop.remove()\n }\n\n if (collectedTrueKeys.length === 0) {\n mutated = true\n return\n }\n\n const sortedKeys = [...collectedTrueKeys].sort()\n const newProps = sortedKeys.map((key) => `${key}: true`).join(', ')\n\n if (!existingDisabled) {\n initializer.addPropertyAssignment({\n name: 'disabled',\n initializer: `{ ${newProps} }`,\n })\n } else {\n const existingInit = existingDisabled.getInitializer()\n if (existingInit?.getKind() === SyntaxKind.TrueKeyword) {\n // disabled: true already covers everything — drop new keys.\n } else if (existingInit?.getKind() === SyntaxKind.FalseKeyword) {\n existingDisabled.setInitializer(`{ ${newProps} }`)\n } else if (existingInit && Node.isObjectLiteralExpression(existingInit)) {\n mergeAndSortObject(existingInit, sortedKeys)\n } else {\n notes.push(\n `${sourceFile.getFilePath()}: existing 'disabled' value is non-literal — merged keys may be incorrect.`,\n )\n }\n }\n\n mutated = true\n })\n\n if (mutated) {\n filesChanged.add(sourceFile.getFilePath())\n }\n }\n\n return { filesChanged: [...filesChanged], notes }\n },\n description:\n 'Migrate field.admin and imageSize.admin disable* props (disableListColumn, disableListFilter, disableGroupBy, disableBulkEdit) into the consolidated disabled object form.',\n}\n\nconst mergeAndSortObject = (existing: ObjectLiteralExpression, newKeys: string[]): void => {\n const merged = new Map<string, string>()\n for (const prop of existing.getProperties()) {\n if (Node.isPropertyAssignment(prop)) {\n const init = prop.getInitializer()\n merged.set(prop.getName(), init?.getText() ?? 'true')\n }\n }\n for (const key of newKeys) {\n if (!merged.has(key)) {\n merged.set(key, 'true')\n }\n }\n const sortedKeys = [...merged.keys()].sort()\n const inline = sortedKeys.map((key) => `${key}: ${merged.get(key)}`).join(', ')\n existing.replaceWithText(`{ ${inline} }`)\n}\n"],"names":["Node","SyntaxKind","OLD_TO_NEW","disableBulkEdit","disableGroupBy","disableListColumn","disableListFilter","migrateDisabledFields","name","apply","project","filesChanged","Set","notes","sourceFile","getSourceFiles","mutated","forEachDescendant","node","isPropertyAssignment","getName","initializer","getInitializer","isObjectLiteralExpression","parent","getParent","getProperty","oldProps","prop","getProperties","push","length","collectedTrueKeys","nonLiteralEncountered","init","getKind","TrueKeyword","FalseKeyword","getFilePath","existingDisabled","find","remove","sortedKeys","sort","newProps","map","key","join","addPropertyAssignment","existingInit","setInitializer","mergeAndSortObject","add","description","existing","newKeys","merged","Map","set","getText","has","keys","inline","get","replaceWithText"],"mappings":"AAEA,SAASA,IAAI,EAAEC,UAAU,QAAQ,WAAU;AAI3C,MAAMC,aAAqC;IACzCC,iBAAiB;IACjBC,gBAAgB;IAChBC,mBAAmB;IACnBC,mBAAmB;AACrB;AAEA,OAAO,MAAMC,wBAAmC;IAC9CC,MAAM;IACNC,OAAO,CAAC,EAAEC,OAAO,EAAE;QACjB,MAAMC,eAAe,IAAIC;QACzB,MAAMC,QAAkB,EAAE;QAE1B,KAAK,MAAMC,cAAcJ,QAAQK,cAAc,GAAI;YACjD,IAAIC,UAAU;YAEdF,WAAWG,iBAAiB,CAAC,CAACC;gBAC5B,IAAI,CAAClB,KAAKmB,oBAAoB,CAACD,OAAO;oBACpC;gBACF;gBACA,IAAIA,KAAKE,OAAO,OAAO,SAAS;oBAC9B;gBACF;gBACA,MAAMC,cAAcH,KAAKI,cAAc;gBACvC,IAAI,CAACD,eAAe,CAACrB,KAAKuB,yBAAyB,CAACF,cAAc;oBAChE;gBACF;gBACA,iGAAiG;gBACjG,4FAA4F;gBAC5F,MAAMG,SAASN,KAAKO,SAAS;gBAC7B,IAAI,CAACD,UAAU,CAACxB,KAAKuB,yBAAyB,CAACC,SAAS;oBACtD;gBACF;gBACA,IAAI,CAACA,OAAOE,WAAW,CAAC,WAAW,CAACF,OAAOE,WAAW,CAAC,SAAS;oBAC9D;gBACF;gBAEA,MAAMC,WAAiC,EAAE;gBACzC,KAAK,MAAMC,QAAQP,YAAYQ,aAAa,GAAI;oBAC9C,IAAI7B,KAAKmB,oBAAoB,CAACS,SAASA,KAAKR,OAAO,MAAMlB,YAAY;wBACnEyB,SAASG,IAAI,CAACF;oBAChB;gBACF;gBAEA,IAAID,SAASI,MAAM,KAAK,GAAG;oBACzB;gBACF;gBAEA,MAAMC,oBAA8B,EAAE;gBACtC,IAAIC,wBAAwB;gBAE5B,KAAK,MAAML,QAAQD,SAAU;oBAC3B,MAAMO,OAAON,KAAKN,cAAc;oBAChC,IAAIY,MAAMC,cAAclC,WAAWmC,WAAW,EAAE;wBAC9CJ,kBAAkBF,IAAI,CAAC5B,UAAU,CAAC0B,KAAKR,OAAO,GAAG;oBACnD,OAAO,IAAIc,MAAMC,cAAclC,WAAWoC,YAAY,EAAE;oBACtD,4DAA4D;oBAC9D,OAAO;wBACLJ,wBAAwB;oBAC1B;gBACF;gBAEA,IAAIA,uBAAuB;oBACzBpB,MAAMiB,IAAI,CACR,GAAGhB,WAAWwB,WAAW,GAAG,+EAA+E,CAAC;oBAE9G;gBACF;gBAEA,MAAMC,mBAAmBlB,YACtBQ,aAAa,GACbW,IAAI,CACH,CAACZ,OACC5B,KAAKmB,oBAAoB,CAACS,SAASA,KAAKR,OAAO,OAAO;gBAG5D,KAAK,MAAMQ,QAAQD,SAAU;oBAC3BC,KAAKa,MAAM;gBACb;gBAEA,IAAIT,kBAAkBD,MAAM,KAAK,GAAG;oBAClCf,UAAU;oBACV;gBACF;gBAEA,MAAM0B,aAAa;uBAAIV;iBAAkB,CAACW,IAAI;gBAC9C,MAAMC,WAAWF,WAAWG,GAAG,CAAC,CAACC,MAAQ,GAAGA,IAAI,MAAM,CAAC,EAAEC,IAAI,CAAC;gBAE9D,IAAI,CAACR,kBAAkB;oBACrBlB,YAAY2B,qBAAqB,CAAC;wBAChCxC,MAAM;wBACNa,aAAa,CAAC,EAAE,EAAEuB,SAAS,EAAE,CAAC;oBAChC;gBACF,OAAO;oBACL,MAAMK,eAAeV,iBAAiBjB,cAAc;oBACpD,IAAI2B,cAAcd,cAAclC,WAAWmC,WAAW,EAAE;oBACtD,4DAA4D;oBAC9D,OAAO,IAAIa,cAAcd,cAAclC,WAAWoC,YAAY,EAAE;wBAC9DE,iBAAiBW,cAAc,CAAC,CAAC,EAAE,EAAEN,SAAS,EAAE,CAAC;oBACnD,OAAO,IAAIK,gBAAgBjD,KAAKuB,yBAAyB,CAAC0B,eAAe;wBACvEE,mBAAmBF,cAAcP;oBACnC,OAAO;wBACL7B,MAAMiB,IAAI,CACR,GAAGhB,WAAWwB,WAAW,GAAG,0EAA0E,CAAC;oBAE3G;gBACF;gBAEAtB,UAAU;YACZ;YAEA,IAAIA,SAAS;gBACXL,aAAayC,GAAG,CAACtC,WAAWwB,WAAW;YACzC;QACF;QAEA,OAAO;YAAE3B,cAAc;mBAAIA;aAAa;YAAEE;QAAM;IAClD;IACAwC,aACE;AACJ,EAAC;AAED,MAAMF,qBAAqB,CAACG,UAAmCC;IAC7D,MAAMC,SAAS,IAAIC;IACnB,KAAK,MAAM7B,QAAQ0B,SAASzB,aAAa,GAAI;QAC3C,IAAI7B,KAAKmB,oBAAoB,CAACS,OAAO;YACnC,MAAMM,OAAON,KAAKN,cAAc;YAChCkC,OAAOE,GAAG,CAAC9B,KAAKR,OAAO,IAAIc,MAAMyB,aAAa;QAChD;IACF;IACA,KAAK,MAAMb,OAAOS,QAAS;QACzB,IAAI,CAACC,OAAOI,GAAG,CAACd,MAAM;YACpBU,OAAOE,GAAG,CAACZ,KAAK;QAClB;IACF;IACA,MAAMJ,aAAa;WAAIc,OAAOK,IAAI;KAAG,CAAClB,IAAI;IAC1C,MAAMmB,SAASpB,WAAWG,GAAG,CAAC,CAACC,MAAQ,GAAGA,IAAI,EAAE,EAAEU,OAAOO,GAAG,CAACjB,MAAM,EAAEC,IAAI,CAAC;IAC1EO,SAASU,eAAe,CAAC,CAAC,EAAE,EAAEF,OAAO,EAAE,CAAC;AAC1C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.spec.d.ts","sourceRoot":"","sources":["../../../src/transforms/migrate-disabled-fields/index.spec.ts"],"names":[],"mappings":""}
|