@payloadcms/codemod 4.0.0-internal.a6582c6 → 4.0.0-internal.af6aad0
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 +3 -1
- package/dist/registry.js.map +1 -1
- package/dist/transforms/migrate-versions-default/index.spec.d.ts +2 -0
- package/dist/transforms/migrate-versions-default/index.spec.d.ts.map +1 -0
- package/dist/transforms/migrate-versions-default/{index.test.js → index.spec.js} +1 -1
- package/dist/transforms/migrate-versions-default/{index.test.js.map → index.spec.js.map} +1 -1
- package/dist/transforms/remove-versions-true/index.spec.d.ts +2 -0
- package/dist/transforms/remove-versions-true/index.spec.d.ts.map +1 -0
- package/dist/transforms/remove-versions-true/{index.test.js → index.spec.js} +1 -1
- package/dist/transforms/remove-versions-true/{index.test.js.map → index.spec.js.map} +1 -1
- package/dist/transforms/rename-experimental-table-feature/alias.input.js +6 -0
- package/dist/transforms/rename-experimental-table-feature/alias.input.js.map +1 -0
- package/dist/transforms/rename-experimental-table-feature/alias.output.js +6 -0
- package/dist/transforms/rename-experimental-table-feature/alias.output.js.map +1 -0
- package/dist/transforms/rename-experimental-table-feature/basic.input.js +19 -0
- package/dist/transforms/rename-experimental-table-feature/basic.input.js.map +1 -0
- package/dist/transforms/rename-experimental-table-feature/basic.output.js +19 -0
- package/dist/transforms/rename-experimental-table-feature/basic.output.js.map +1 -0
- package/dist/transforms/rename-experimental-table-feature/collision.input.js +7 -0
- package/dist/transforms/rename-experimental-table-feature/collision.input.js.map +1 -0
- package/dist/transforms/rename-experimental-table-feature/index.d.ts +3 -0
- package/dist/transforms/rename-experimental-table-feature/index.d.ts.map +1 -0
- package/dist/transforms/rename-experimental-table-feature/index.js +44 -0
- package/dist/transforms/rename-experimental-table-feature/index.js.map +1 -0
- package/dist/transforms/rename-experimental-table-feature/index.spec.d.ts +2 -0
- package/dist/transforms/rename-experimental-table-feature/index.spec.d.ts.map +1 -0
- package/dist/transforms/rename-experimental-table-feature/index.spec.js +54 -0
- package/dist/transforms/rename-experimental-table-feature/index.spec.js.map +1 -0
- package/dist/transforms/rename-experimental-table-feature/no-match.input.js +9 -0
- package/dist/transforms/rename-experimental-table-feature/no-match.input.js.map +1 -0
- package/package.json +1 -1
- package/dist/transforms/migrate-versions-default/index.test.d.ts +0 -2
- package/dist/transforms/migrate-versions-default/index.test.d.ts.map +0 -1
- package/dist/transforms/remove-versions-true/index.test.d.ts +0 -2
- package/dist/transforms/remove-versions-true/index.test.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -48,6 +48,7 @@ The tool loads your project via [ts-morph](https://ts-morph.com/), using your `t
|
|
|
48
48
|
- `rename-typescript-schema-to-json-schema` — renames the `typescriptSchema` field-config property to `jsonSchema` (it always accepted JSON Schema, not TypeScript). Skips any object that already defines a `jsonSchema` sibling and surfaces it as a note for manual review.
|
|
49
49
|
- `migrate-build-script` — rewrites the `build` npm script in `package.json` from `next build` to `payload build`, so the Import Map (and types) are generated before the Next.js build. Matches the `next build` invocation only (leaves `next build-storybook` and the like untouched) and is a no-op when `build` is already `payload build`.
|
|
50
50
|
- `migrate-slug-field` — converts the removed experimental `slugField()` helper (imported from `payload`) into the native `{ type: 'slug' }` field, mapping `useAsSlug`/`fieldToUse`, `slugify`, `required`, `localized`, `disableUnique` (→ `unique: false`), and `position` (→ `admin.position`), and dropping the obsolete `checkboxName`. Removes the now-unused `slugField` import. Calls using `overrides` (or other unrecognized options) are left in place with a note for manual migration.
|
|
51
|
+
- `rename-experimental-table-feature` — renames imports of `EXPERIMENTAL_TableFeature` from `@payloadcms/richtext-lexical` to `TableFeature` (the table feature is now stable) and updates all local usages, e.g. `EXPERIMENTAL_TableFeature()` call sites.
|
|
51
52
|
|
|
52
53
|
## Contributing
|
|
53
54
|
|
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;AA6B3C,eAAO,MAAM,UAAU,EAAE,SAAS,EA2BjC,CAAA"}
|
package/dist/registry.js
CHANGED
|
@@ -21,6 +21,7 @@ import { removeGroupByTrue } from './transforms/remove-group-by-true/index.js';
|
|
|
21
21
|
import { removeLocalizeStatusConfig } from './transforms/remove-localize-status-config/index.js';
|
|
22
22
|
import { removePublishSpecificLocale } from './transforms/remove-publish-specific-locale/index.js';
|
|
23
23
|
import { removeVersionsTrue } from './transforms/remove-versions-true/index.js';
|
|
24
|
+
import { renameExperimentalTableFeature } from './transforms/rename-experimental-table-feature/index.js';
|
|
24
25
|
import { renameStorageAdaptersToStorage } from './transforms/rename-storage-adapters-to-storage/index.js';
|
|
25
26
|
import { renameTypescriptSchemaToJsonSchema } from './transforms/rename-typescript-schema-to-json-schema/index.js';
|
|
26
27
|
export const transforms = [
|
|
@@ -48,7 +49,8 @@ export const transforms = [
|
|
|
48
49
|
removeLocalizeStatusConfig,
|
|
49
50
|
removeVersionsTrue,
|
|
50
51
|
removePublishSpecificLocale,
|
|
51
|
-
renameTypescriptSchemaToJsonSchema
|
|
52
|
+
renameTypescriptSchemaToJsonSchema,
|
|
53
|
+
renameExperimentalTableFeature
|
|
52
54
|
];
|
|
53
55
|
|
|
54
56
|
//# sourceMappingURL=registry.js.map
|
package/dist/registry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/registry.ts"],"sourcesContent":["import type { Transform } from './types.js'\n\nimport { exampleNoop } from './transforms/example-noop/index.js'\nimport { globalsComponentsEdit } from './transforms/globals-components-edit/index.js'\nimport { migrateAfterOperationRead } from './transforms/migrate-after-operation-read/index.js'\nimport { migrateAliasedExports } from './transforms/migrate-aliased-exports/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 { 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 { 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 { 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 { removeVersionsTrue } from './transforms/remove-versions-true/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 migrateAfterOperationRead,\n migrateHideAPIURL,\n globalsComponentsEdit,\n migrateListViewSelectAPI,\n migrateDisabledFields,\n migrateForceSelect,\n migrateAliasedExports,\n migrateBlockReferencesToBlocks,\n migrateBuildScript,\n migrateDocumentTitleContext,\n migrateStorageAdaptersToConfig,\n migrateAzureChunkLargeFiles,\n renameStorageAdaptersToStorage,\n migrateImportExportHooks,\n migrateDbTypesSubpath,\n migrateNextGenerateViewportExport,\n migrateNextSubpathExports,\n migrateSlugField,\n migrateVersionsDefault,\n removeGroupByTrue,\n removeLocalizeStatusConfig,\n removeVersionsTrue,\n removePublishSpecificLocale,\n renameTypescriptSchemaToJsonSchema,\n]\n"],"names":["exampleNoop","globalsComponentsEdit","migrateAfterOperationRead","migrateAliasedExports","migrateAzureChunkLargeFiles","migrateBlockReferencesToBlocks","migrateBuildScript","migrateDbTypesSubpath","migrateDisabledFields","migrateDocumentTitleContext","migrateForceSelect","migrateHideAPIURL","migrateImportExportHooks","migrateListViewSelectAPI","migrateNextGenerateViewportExport","migrateNextSubpathExports","migrateSlugField","migrateStorageAdaptersToConfig","migrateVersionsDefault","removeGroupByTrue","removeLocalizeStatusConfig","removePublishSpecificLocale","removeVersionsTrue","renameStorageAdaptersToStorage","renameTypescriptSchemaToJsonSchema","transforms"],"mappings":"AAEA,SAASA,WAAW,QAAQ,qCAAoC;AAChE,SAASC,qBAAqB,QAAQ,gDAA+C;AACrF,SAASC,yBAAyB,QAAQ,qDAAoD;AAC9F,SAASC,qBAAqB,QAAQ,gDAA+C;AACrF,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,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,gBAAgB,QAAQ,2CAA0C;AAC3E,SAASC,8BAA8B,QAAQ,2DAA0D;AACzG,SAASC,sBAAsB,QAAQ,iDAAgD;AACvF,SAASC,iBAAiB,QAAQ,6CAA4C;AAC9E,SAASC,0BAA0B,QAAQ,sDAAqD;AAChG,SAASC,2BAA2B,QAAQ,uDAAsD;AAClG,SAASC,kBAAkB,QAAQ,6CAA4C;AAC/E,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 { exampleNoop } from './transforms/example-noop/index.js'\nimport { globalsComponentsEdit } from './transforms/globals-components-edit/index.js'\nimport { migrateAfterOperationRead } from './transforms/migrate-after-operation-read/index.js'\nimport { migrateAliasedExports } from './transforms/migrate-aliased-exports/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 { 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 { 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 { 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 { removeVersionsTrue } from './transforms/remove-versions-true/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 migrateAfterOperationRead,\n migrateHideAPIURL,\n globalsComponentsEdit,\n migrateListViewSelectAPI,\n migrateDisabledFields,\n migrateForceSelect,\n migrateAliasedExports,\n migrateBlockReferencesToBlocks,\n migrateBuildScript,\n migrateDocumentTitleContext,\n migrateStorageAdaptersToConfig,\n migrateAzureChunkLargeFiles,\n renameStorageAdaptersToStorage,\n migrateImportExportHooks,\n migrateDbTypesSubpath,\n migrateNextGenerateViewportExport,\n migrateNextSubpathExports,\n migrateSlugField,\n migrateVersionsDefault,\n removeGroupByTrue,\n removeLocalizeStatusConfig,\n removeVersionsTrue,\n removePublishSpecificLocale,\n renameTypescriptSchemaToJsonSchema,\n renameExperimentalTableFeature,\n]\n"],"names":["exampleNoop","globalsComponentsEdit","migrateAfterOperationRead","migrateAliasedExports","migrateAzureChunkLargeFiles","migrateBlockReferencesToBlocks","migrateBuildScript","migrateDbTypesSubpath","migrateDisabledFields","migrateDocumentTitleContext","migrateForceSelect","migrateHideAPIURL","migrateImportExportHooks","migrateListViewSelectAPI","migrateNextGenerateViewportExport","migrateNextSubpathExports","migrateSlugField","migrateStorageAdaptersToConfig","migrateVersionsDefault","removeGroupByTrue","removeLocalizeStatusConfig","removePublishSpecificLocale","removeVersionsTrue","renameExperimentalTableFeature","renameStorageAdaptersToStorage","renameTypescriptSchemaToJsonSchema","transforms"],"mappings":"AAEA,SAASA,WAAW,QAAQ,qCAAoC;AAChE,SAASC,qBAAqB,QAAQ,gDAA+C;AACrF,SAASC,yBAAyB,QAAQ,qDAAoD;AAC9F,SAASC,qBAAqB,QAAQ,gDAA+C;AACrF,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,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,gBAAgB,QAAQ,2CAA0C;AAC3E,SAASC,8BAA8B,QAAQ,2DAA0D;AACzG,SAASC,sBAAsB,QAAQ,iDAAgD;AACvF,SAASC,iBAAiB,QAAQ,6CAA4C;AAC9E,SAASC,0BAA0B,QAAQ,sDAAqD;AAChG,SAASC,2BAA2B,QAAQ,uDAAsD;AAClG,SAASC,kBAAkB,QAAQ,6CAA4C;AAC/E,SAASC,8BAA8B,QAAQ,0DAAyD;AACxG,SAASC,8BAA8B,QAAQ,2DAA0D;AACzG,SAASC,kCAAkC,QAAQ,gEAA+D;AAElH,OAAO,MAAMC,aAA0B;IACrC1B;IACAE;IACAS;IACAV;IACAY;IACAL;IACAE;IACAP;IACAE;IACAC;IACAG;IACAQ;IACAb;IACAoB;IACAZ;IACAL;IACAO;IACAC;IACAC;IACAE;IACAC;IACAC;IACAE;IACAD;IACAI;IACAF;CACD,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.spec.d.ts","sourceRoot":"","sources":["../../../src/transforms/migrate-versions-default/index.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/transforms/migrate-versions-default/index.
|
|
1
|
+
{"version":3,"sources":["../../../src/transforms/migrate-versions-default/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 { migrateVersionsDefault } from './index.js'\n\nconst here = dirname(fileURLToPath(import.meta.url))\nconst fixture = (name: string) => readFile(join(here, name), 'utf8')\n\ndescribe('migrate-versions-default', () => {\n it('adds versions: false to CollectionConfig objects without a versions property', 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: migrateVersionsDefault })\n\n expect(result).toBe(output)\n })\n\n it('is idempotent', async () => {\n const output = await fixture('basic.output.ts')\n\n const result = await runTransform({ source: output, transform: migrateVersionsDefault })\n\n expect(result).toBe(output)\n })\n\n it('does not modify collections that already have a versions property', async () => {\n const input = await fixture('already-set.input.ts')\n const output = await fixture('already-set.output.ts')\n\n const result = await runTransform({ source: input, transform: migrateVersionsDefault })\n\n expect(result).toBe(output)\n })\n\n it('handles satisfies CollectionConfig form', async () => {\n const input = await fixture('satisfies.input.ts')\n const output = await fixture('satisfies.output.ts')\n\n const result = await runTransform({ source: input, transform: migrateVersionsDefault })\n\n expect(result).toBe(output)\n })\n\n it('is idempotent on satisfies output', async () => {\n const output = await fixture('satisfies.output.ts')\n\n const result = await runTransform({ source: output, transform: migrateVersionsDefault })\n\n expect(result).toBe(output)\n })\n\n it('adds versions: false to GlobalConfig objects without a versions property', async () => {\n const input = await fixture('globals.input.ts')\n const output = await fixture('globals.output.ts')\n\n const result = await runTransform({ source: input, transform: migrateVersionsDefault })\n\n expect(result).toBe(output)\n })\n\n it('is idempotent on globals output', async () => {\n const output = await fixture('globals.output.ts')\n\n const result = await runTransform({ source: output, transform: migrateVersionsDefault })\n\n expect(result).toBe(output)\n })\n\n it('no-ops on non-Collection/GlobalConfig objects', async () => {\n const input = await fixture('non-matching.input.ts')\n const output = await fixture('non-matching.output.ts')\n\n const result = await runTransform({ source: input, transform: migrateVersionsDefault })\n\n expect(result).toBe(output)\n })\n})\n"],"names":["readFile","dirname","join","fileURLToPath","describe","expect","it","runTransform","migrateVersionsDefault","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,sBAAsB,QAAQ,aAAY;AAEnD,MAAMC,OAAOR,QAAQE,cAAc,YAAYO,GAAG;AAClD,MAAMC,UAAU,CAACC,OAAiBZ,SAASE,KAAKO,MAAMG,OAAO;AAE7DR,SAAS,4BAA4B;IACnCE,GAAG,gFAAgF;QACjF,MAAMO,QAAQ,MAAMF,QAAQ;QAC5B,MAAMG,SAAS,MAAMH,QAAQ;QAE7B,MAAMI,SAAS,MAAMR,aAAa;YAAES,QAAQH;YAAOI,WAAWT;QAAuB;QAErFH,OAAOU,QAAQG,IAAI,CAACJ;IACtB;IAEAR,GAAG,iBAAiB;QAClB,MAAMQ,SAAS,MAAMH,QAAQ;QAE7B,MAAMI,SAAS,MAAMR,aAAa;YAAES,QAAQF;YAAQG,WAAWT;QAAuB;QAEtFH,OAAOU,QAAQG,IAAI,CAACJ;IACtB;IAEAR,GAAG,qEAAqE;QACtE,MAAMO,QAAQ,MAAMF,QAAQ;QAC5B,MAAMG,SAAS,MAAMH,QAAQ;QAE7B,MAAMI,SAAS,MAAMR,aAAa;YAAES,QAAQH;YAAOI,WAAWT;QAAuB;QAErFH,OAAOU,QAAQG,IAAI,CAACJ;IACtB;IAEAR,GAAG,2CAA2C;QAC5C,MAAMO,QAAQ,MAAMF,QAAQ;QAC5B,MAAMG,SAAS,MAAMH,QAAQ;QAE7B,MAAMI,SAAS,MAAMR,aAAa;YAAES,QAAQH;YAAOI,WAAWT;QAAuB;QAErFH,OAAOU,QAAQG,IAAI,CAACJ;IACtB;IAEAR,GAAG,qCAAqC;QACtC,MAAMQ,SAAS,MAAMH,QAAQ;QAE7B,MAAMI,SAAS,MAAMR,aAAa;YAAES,QAAQF;YAAQG,WAAWT;QAAuB;QAEtFH,OAAOU,QAAQG,IAAI,CAACJ;IACtB;IAEAR,GAAG,4EAA4E;QAC7E,MAAMO,QAAQ,MAAMF,QAAQ;QAC5B,MAAMG,SAAS,MAAMH,QAAQ;QAE7B,MAAMI,SAAS,MAAMR,aAAa;YAAES,QAAQH;YAAOI,WAAWT;QAAuB;QAErFH,OAAOU,QAAQG,IAAI,CAACJ;IACtB;IAEAR,GAAG,mCAAmC;QACpC,MAAMQ,SAAS,MAAMH,QAAQ;QAE7B,MAAMI,SAAS,MAAMR,aAAa;YAAES,QAAQF;YAAQG,WAAWT;QAAuB;QAEtFH,OAAOU,QAAQG,IAAI,CAACJ;IACtB;IAEAR,GAAG,iDAAiD;QAClD,MAAMO,QAAQ,MAAMF,QAAQ;QAC5B,MAAMG,SAAS,MAAMH,QAAQ;QAE7B,MAAMI,SAAS,MAAMR,aAAa;YAAES,QAAQH;YAAOI,WAAWT;QAAuB;QAErFH,OAAOU,QAAQG,IAAI,CAACJ;IACtB;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.spec.d.ts","sourceRoot":"","sources":["../../../src/transforms/remove-versions-true/index.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/transforms/remove-versions-true/index.
|
|
1
|
+
{"version":3,"sources":["../../../src/transforms/remove-versions-true/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 { removeVersionsTrue } from './index.js'\n\nconst here = dirname(fileURLToPath(import.meta.url))\nconst fixture = (name: string) => readFile(join(here, name), 'utf8')\n\ndescribe('remove-versions-true', () => {\n it('removes bare versions: true from CollectionConfig and GlobalConfig', 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: removeVersionsTrue })\n\n expect(result).toBe(output)\n })\n\n it('is idempotent', async () => {\n const output = await fixture('basic.output.ts')\n\n const result = await runTransform({ source: output, transform: removeVersionsTrue })\n\n expect(result).toBe(output)\n })\n\n it('does not remove versions object configs or versions: false', async () => {\n const input = await fixture('non-matching.input.ts')\n const output = await fixture('non-matching.output.ts')\n\n const result = await runTransform({ source: input, transform: removeVersionsTrue })\n\n expect(result).toBe(output)\n })\n})\n"],"names":["readFile","dirname","join","fileURLToPath","describe","expect","it","runTransform","removeVersionsTrue","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,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,sEAAsE;QACvE,MAAMO,QAAQ,MAAMF,QAAQ;QAC5B,MAAMG,SAAS,MAAMH,QAAQ;QAE7B,MAAMI,SAAS,MAAMR,aAAa;YAAES,QAAQH;YAAOI,WAAWT;QAAmB;QAEjFH,OAAOU,QAAQG,IAAI,CAACJ;IACtB;IAEAR,GAAG,iBAAiB;QAClB,MAAMQ,SAAS,MAAMH,QAAQ;QAE7B,MAAMI,SAAS,MAAMR,aAAa;YAAES,QAAQF;YAAQG,WAAWT;QAAmB;QAElFH,OAAOU,QAAQG,IAAI,CAACJ;IACtB;IAEAR,GAAG,8DAA8D;QAC/D,MAAMO,QAAQ,MAAMF,QAAQ;QAC5B,MAAMG,SAAS,MAAMH,QAAQ;QAE7B,MAAMI,SAAS,MAAMR,aAAa;YAAES,QAAQH;YAAOI,WAAWT;QAAmB;QAEjFH,OAAOU,QAAQG,IAAI,CAACJ;IACtB;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/transforms/rename-experimental-table-feature/alias.input.ts"],"sourcesContent":["import { EXPERIMENTAL_TableFeature as TableFeatureFn } from '@payloadcms/richtext-lexical'\n\nexport const features = [TableFeatureFn()]\n"],"names":["EXPERIMENTAL_TableFeature","TableFeatureFn","features"],"mappings":"AAAA,SAASA,6BAA6BC,cAAc,QAAQ,+BAA8B;AAE1F,OAAO,MAAMC,WAAW;IAACD;CAAiB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/transforms/rename-experimental-table-feature/alias.output.ts"],"sourcesContent":["import { TableFeature as TableFeatureFn } from '@payloadcms/richtext-lexical'\n\nexport const features = [TableFeatureFn()]\n"],"names":["TableFeature","TableFeatureFn","features"],"mappings":"AAAA,SAASA,gBAAgBC,cAAc,QAAQ,+BAA8B;AAE7E,OAAO,MAAMC,WAAW;IAACD;CAAiB,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { EXPERIMENTAL_TableFeature, FixedToolbarFeature, lexicalEditor } from '@payloadcms/richtext-lexical';
|
|
2
|
+
export const RichText = {
|
|
3
|
+
fields: [
|
|
4
|
+
{
|
|
5
|
+
name: 'content',
|
|
6
|
+
type: 'richText',
|
|
7
|
+
editor: lexicalEditor({
|
|
8
|
+
features: ({ defaultFeatures })=>[
|
|
9
|
+
...defaultFeatures,
|
|
10
|
+
FixedToolbarFeature(),
|
|
11
|
+
EXPERIMENTAL_TableFeature()
|
|
12
|
+
]
|
|
13
|
+
})
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
slug: 'richtext'
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=basic.input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/transforms/rename-experimental-table-feature/basic.input.ts"],"sourcesContent":["import type { CollectionConfig } from 'payload'\n\nimport { EXPERIMENTAL_TableFeature, FixedToolbarFeature, lexicalEditor } from '@payloadcms/richtext-lexical'\n\nexport const RichText: CollectionConfig = {\n fields: [\n {\n name: 'content',\n type: 'richText',\n editor: lexicalEditor({\n features: ({ defaultFeatures }) => [\n ...defaultFeatures,\n FixedToolbarFeature(),\n EXPERIMENTAL_TableFeature(),\n ],\n }),\n },\n ],\n slug: 'richtext',\n}\n"],"names":["EXPERIMENTAL_TableFeature","FixedToolbarFeature","lexicalEditor","RichText","fields","name","type","editor","features","defaultFeatures","slug"],"mappings":"AAEA,SAASA,yBAAyB,EAAEC,mBAAmB,EAAEC,aAAa,QAAQ,+BAA8B;AAE5G,OAAO,MAAMC,WAA6B;IACxCC,QAAQ;QACN;YACEC,MAAM;YACNC,MAAM;YACNC,QAAQL,cAAc;gBACpBM,UAAU,CAAC,EAAEC,eAAe,EAAE,GAAK;2BAC9BA;wBACHR;wBACAD;qBACD;YACH;QACF;KACD;IACDU,MAAM;AACR,EAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { TableFeature, FixedToolbarFeature, lexicalEditor } from '@payloadcms/richtext-lexical';
|
|
2
|
+
export const RichText = {
|
|
3
|
+
fields: [
|
|
4
|
+
{
|
|
5
|
+
name: 'content',
|
|
6
|
+
type: 'richText',
|
|
7
|
+
editor: lexicalEditor({
|
|
8
|
+
features: ({ defaultFeatures })=>[
|
|
9
|
+
...defaultFeatures,
|
|
10
|
+
FixedToolbarFeature(),
|
|
11
|
+
TableFeature()
|
|
12
|
+
]
|
|
13
|
+
})
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
slug: 'richtext'
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=basic.output.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/transforms/rename-experimental-table-feature/basic.output.ts"],"sourcesContent":["import type { CollectionConfig } from 'payload'\n\nimport { TableFeature, FixedToolbarFeature, lexicalEditor } from '@payloadcms/richtext-lexical'\n\nexport const RichText: CollectionConfig = {\n fields: [\n {\n name: 'content',\n type: 'richText',\n editor: lexicalEditor({\n features: ({ defaultFeatures }) => [\n ...defaultFeatures,\n FixedToolbarFeature(),\n TableFeature(),\n ],\n }),\n },\n ],\n slug: 'richtext',\n}\n"],"names":["TableFeature","FixedToolbarFeature","lexicalEditor","RichText","fields","name","type","editor","features","defaultFeatures","slug"],"mappings":"AAEA,SAASA,YAAY,EAAEC,mBAAmB,EAAEC,aAAa,QAAQ,+BAA8B;AAE/F,OAAO,MAAMC,WAA6B;IACxCC,QAAQ;QACN;YACEC,MAAM;YACNC,MAAM;YACNC,QAAQL,cAAc;gBACpBM,UAAU,CAAC,EAAEC,eAAe,EAAE,GAAK;2BAC9BA;wBACHR;wBACAD;qBACD;YACH;QACF;KACD;IACDU,MAAM;AACR,EAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/transforms/rename-experimental-table-feature/collision.input.ts"],"sourcesContent":["import { EXPERIMENTAL_TableFeature, TableFeature } from '@payloadcms/richtext-lexical'\n\nexport const features = [EXPERIMENTAL_TableFeature(), TableFeature()]\n"],"names":["EXPERIMENTAL_TableFeature","TableFeature","features"],"mappings":"AAAA,SAASA,yBAAyB,EAAEC,YAAY,QAAQ,+BAA8B;AAEtF,OAAO,MAAMC,WAAW;IAACF;IAA6BC;CAAe,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/transforms/rename-experimental-table-feature/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAM/C,eAAO,MAAM,8BAA8B,EAAE,SA2C5C,CAAA"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
const PACKAGE_NAME = '@payloadcms/richtext-lexical';
|
|
2
|
+
const OLD_NAME = 'EXPERIMENTAL_TableFeature';
|
|
3
|
+
const NEW_NAME = 'TableFeature';
|
|
4
|
+
export const renameExperimentalTableFeature = {
|
|
5
|
+
name: 'rename-experimental-table-feature',
|
|
6
|
+
apply: ({ project })=>{
|
|
7
|
+
const filesChanged = new Set();
|
|
8
|
+
for (const file of project.getSourceFiles()){
|
|
9
|
+
for (const importDecl of file.getImportDeclarations()){
|
|
10
|
+
if (importDecl.getModuleSpecifierValue() !== PACKAGE_NAME) {
|
|
11
|
+
continue;
|
|
12
|
+
}
|
|
13
|
+
const named = importDecl.getNamedImports();
|
|
14
|
+
const spec = named.find((specifier)=>specifier.getName() === OLD_NAME);
|
|
15
|
+
if (!spec) {
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
// Skip if `TableFeature` is already imported here too, to avoid a collision.
|
|
19
|
+
const hasNewName = named.some((specifier)=>(specifier.getAliasNode()?.getText() ?? specifier.getName()) === NEW_NAME);
|
|
20
|
+
if (hasNewName) {
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
if (spec.getAliasNode()) {
|
|
24
|
+
// Aliased usages (`EXPERIMENTAL_TableFeature as Foo`) only reference the alias,
|
|
25
|
+
// so the imported name can be swapped without touching call sites.
|
|
26
|
+
spec.setName(NEW_NAME);
|
|
27
|
+
} else {
|
|
28
|
+
// No alias: the imported name is also the local binding, so rename it to update
|
|
29
|
+
// every call site (e.g. `EXPERIMENTAL_TableFeature()`) in the same pass.
|
|
30
|
+
spec.getNameNode().rename(NEW_NAME);
|
|
31
|
+
}
|
|
32
|
+
filesChanged.add(file.getFilePath());
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
filesChanged: [
|
|
37
|
+
...filesChanged
|
|
38
|
+
]
|
|
39
|
+
};
|
|
40
|
+
},
|
|
41
|
+
description: 'Renames imports of `EXPERIMENTAL_TableFeature` from `@payloadcms/richtext-lexical` to `TableFeature` (the table feature is now stable) and updates all local usages.'
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/transforms/rename-experimental-table-feature/index.ts"],"sourcesContent":["import type { Transform } from '../../types.js'\n\nconst PACKAGE_NAME = '@payloadcms/richtext-lexical'\nconst OLD_NAME = 'EXPERIMENTAL_TableFeature'\nconst NEW_NAME = 'TableFeature'\n\nexport const renameExperimentalTableFeature: Transform = {\n name: 'rename-experimental-table-feature',\n apply: ({ project }) => {\n const filesChanged = new Set<string>()\n\n for (const file of project.getSourceFiles()) {\n for (const importDecl of file.getImportDeclarations()) {\n if (importDecl.getModuleSpecifierValue() !== PACKAGE_NAME) {\n continue\n }\n\n const named = importDecl.getNamedImports()\n const spec = named.find((specifier) => specifier.getName() === OLD_NAME)\n if (!spec) {\n continue\n }\n\n // Skip if `TableFeature` is already imported here too, to avoid a collision.\n const hasNewName = named.some(\n (specifier) => (specifier.getAliasNode()?.getText() ?? specifier.getName()) === NEW_NAME,\n )\n if (hasNewName) {\n continue\n }\n\n if (spec.getAliasNode()) {\n // Aliased usages (`EXPERIMENTAL_TableFeature as Foo`) only reference the alias,\n // so the imported name can be swapped without touching call sites.\n spec.setName(NEW_NAME)\n } else {\n // No alias: the imported name is also the local binding, so rename it to update\n // every call site (e.g. `EXPERIMENTAL_TableFeature()`) in the same pass.\n spec.getNameNode().rename(NEW_NAME)\n }\n\n filesChanged.add(file.getFilePath())\n }\n }\n\n return { filesChanged: [...filesChanged] }\n },\n description:\n 'Renames imports of `EXPERIMENTAL_TableFeature` from `@payloadcms/richtext-lexical` to `TableFeature` (the table feature is now stable) and updates all local usages.',\n}\n"],"names":["PACKAGE_NAME","OLD_NAME","NEW_NAME","renameExperimentalTableFeature","name","apply","project","filesChanged","Set","file","getSourceFiles","importDecl","getImportDeclarations","getModuleSpecifierValue","named","getNamedImports","spec","find","specifier","getName","hasNewName","some","getAliasNode","getText","setName","getNameNode","rename","add","getFilePath","description"],"mappings":"AAEA,MAAMA,eAAe;AACrB,MAAMC,WAAW;AACjB,MAAMC,WAAW;AAEjB,OAAO,MAAMC,iCAA4C;IACvDC,MAAM;IACNC,OAAO,CAAC,EAAEC,OAAO,EAAE;QACjB,MAAMC,eAAe,IAAIC;QAEzB,KAAK,MAAMC,QAAQH,QAAQI,cAAc,GAAI;YAC3C,KAAK,MAAMC,cAAcF,KAAKG,qBAAqB,GAAI;gBACrD,IAAID,WAAWE,uBAAuB,OAAOb,cAAc;oBACzD;gBACF;gBAEA,MAAMc,QAAQH,WAAWI,eAAe;gBACxC,MAAMC,OAAOF,MAAMG,IAAI,CAAC,CAACC,YAAcA,UAAUC,OAAO,OAAOlB;gBAC/D,IAAI,CAACe,MAAM;oBACT;gBACF;gBAEA,6EAA6E;gBAC7E,MAAMI,aAAaN,MAAMO,IAAI,CAC3B,CAACH,YAAc,AAACA,CAAAA,UAAUI,YAAY,IAAIC,aAAaL,UAAUC,OAAO,EAAC,MAAOjB;gBAElF,IAAIkB,YAAY;oBACd;gBACF;gBAEA,IAAIJ,KAAKM,YAAY,IAAI;oBACvB,gFAAgF;oBAChF,mEAAmE;oBACnEN,KAAKQ,OAAO,CAACtB;gBACf,OAAO;oBACL,gFAAgF;oBAChF,yEAAyE;oBACzEc,KAAKS,WAAW,GAAGC,MAAM,CAACxB;gBAC5B;gBAEAK,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/rename-experimental-table-feature/index.spec.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,54 @@
|
|
|
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 { renameExperimentalTableFeature } from './index.js';
|
|
7
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
const fixture = (name)=>readFile(join(here, name), 'utf8');
|
|
9
|
+
describe('rename-experimental-table-feature', ()=>{
|
|
10
|
+
it('renames EXPERIMENTAL_TableFeature to TableFeature and updates call sites', 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: renameExperimentalTableFeature
|
|
16
|
+
});
|
|
17
|
+
expect(result).toBe(output);
|
|
18
|
+
});
|
|
19
|
+
it('is idempotent', async ()=>{
|
|
20
|
+
const output = await fixture('basic.output.ts');
|
|
21
|
+
const result = await runTransform({
|
|
22
|
+
source: output,
|
|
23
|
+
transform: renameExperimentalTableFeature
|
|
24
|
+
});
|
|
25
|
+
expect(result).toBe(output);
|
|
26
|
+
});
|
|
27
|
+
it('renames the imported name without touching an aliased local binding', async ()=>{
|
|
28
|
+
const input = await fixture('alias.input.ts');
|
|
29
|
+
const output = await fixture('alias.output.ts');
|
|
30
|
+
const result = await runTransform({
|
|
31
|
+
source: input,
|
|
32
|
+
transform: renameExperimentalTableFeature
|
|
33
|
+
});
|
|
34
|
+
expect(result).toBe(output);
|
|
35
|
+
});
|
|
36
|
+
it('no-ops on code without EXPERIMENTAL_TableFeature', async ()=>{
|
|
37
|
+
const input = await fixture('no-match.input.ts');
|
|
38
|
+
const result = await runTransform({
|
|
39
|
+
source: input,
|
|
40
|
+
transform: renameExperimentalTableFeature
|
|
41
|
+
});
|
|
42
|
+
expect(result).toBe(input);
|
|
43
|
+
});
|
|
44
|
+
it('skips the rename when TableFeature is already imported from the same declaration', async ()=>{
|
|
45
|
+
const input = await fixture('collision.input.ts');
|
|
46
|
+
const result = await runTransform({
|
|
47
|
+
source: input,
|
|
48
|
+
transform: renameExperimentalTableFeature
|
|
49
|
+
});
|
|
50
|
+
expect(result).toBe(input);
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
//# sourceMappingURL=index.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/transforms/rename-experimental-table-feature/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 { renameExperimentalTableFeature } from './index.js'\n\nconst here = dirname(fileURLToPath(import.meta.url))\nconst fixture = (name: string) => readFile(join(here, name), 'utf8')\n\ndescribe('rename-experimental-table-feature', () => {\n it('renames EXPERIMENTAL_TableFeature to TableFeature and updates call sites', 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: renameExperimentalTableFeature })\n\n expect(result).toBe(output)\n })\n\n it('is idempotent', async () => {\n const output = await fixture('basic.output.ts')\n\n const result = await runTransform({ source: output, transform: renameExperimentalTableFeature })\n\n expect(result).toBe(output)\n })\n\n it('renames the imported name without touching an aliased local binding', async () => {\n const input = await fixture('alias.input.ts')\n const output = await fixture('alias.output.ts')\n\n const result = await runTransform({ source: input, transform: renameExperimentalTableFeature })\n\n expect(result).toBe(output)\n })\n\n it('no-ops on code without EXPERIMENTAL_TableFeature', async () => {\n const input = await fixture('no-match.input.ts')\n\n const result = await runTransform({ source: input, transform: renameExperimentalTableFeature })\n\n expect(result).toBe(input)\n })\n\n it('skips the rename when TableFeature is already imported from the same declaration', async () => {\n const input = await fixture('collision.input.ts')\n\n const result = await runTransform({ source: input, transform: renameExperimentalTableFeature })\n\n expect(result).toBe(input)\n })\n})\n"],"names":["readFile","dirname","join","fileURLToPath","describe","expect","it","runTransform","renameExperimentalTableFeature","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,8BAA8B,QAAQ,aAAY;AAE3D,MAAMC,OAAOR,QAAQE,cAAc,YAAYO,GAAG;AAClD,MAAMC,UAAU,CAACC,OAAiBZ,SAASE,KAAKO,MAAMG,OAAO;AAE7DR,SAAS,qCAAqC;IAC5CE,GAAG,4EAA4E;QAC7E,MAAMO,QAAQ,MAAMF,QAAQ;QAC5B,MAAMG,SAAS,MAAMH,QAAQ;QAE7B,MAAMI,SAAS,MAAMR,aAAa;YAAES,QAAQH;YAAOI,WAAWT;QAA+B;QAE7FH,OAAOU,QAAQG,IAAI,CAACJ;IACtB;IAEAR,GAAG,iBAAiB;QAClB,MAAMQ,SAAS,MAAMH,QAAQ;QAE7B,MAAMI,SAAS,MAAMR,aAAa;YAAES,QAAQF;YAAQG,WAAWT;QAA+B;QAE9FH,OAAOU,QAAQG,IAAI,CAACJ;IACtB;IAEAR,GAAG,uEAAuE;QACxE,MAAMO,QAAQ,MAAMF,QAAQ;QAC5B,MAAMG,SAAS,MAAMH,QAAQ;QAE7B,MAAMI,SAAS,MAAMR,aAAa;YAAES,QAAQH;YAAOI,WAAWT;QAA+B;QAE7FH,OAAOU,QAAQG,IAAI,CAACJ;IACtB;IAEAR,GAAG,oDAAoD;QACrD,MAAMO,QAAQ,MAAMF,QAAQ;QAE5B,MAAMI,SAAS,MAAMR,aAAa;YAAES,QAAQH;YAAOI,WAAWT;QAA+B;QAE7FH,OAAOU,QAAQG,IAAI,CAACL;IACtB;IAEAP,GAAG,oFAAoF;QACrF,MAAMO,QAAQ,MAAMF,QAAQ;QAE5B,MAAMI,SAAS,MAAMR,aAAa;YAAES,QAAQH;YAAOI,WAAWT;QAA+B;QAE7FH,OAAOU,QAAQG,IAAI,CAACL;IACtB;AACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/transforms/rename-experimental-table-feature/no-match.input.ts"],"sourcesContent":["import { FixedToolbarFeature, lexicalEditor } from '@payloadcms/richtext-lexical'\n\nexport const editor = lexicalEditor({\n features: ({ defaultFeatures }) => [...defaultFeatures, FixedToolbarFeature()],\n})\n"],"names":["FixedToolbarFeature","lexicalEditor","editor","features","defaultFeatures"],"mappings":"AAAA,SAASA,mBAAmB,EAAEC,aAAa,QAAQ,+BAA8B;AAEjF,OAAO,MAAMC,SAASD,cAAc;IAClCE,UAAU,CAAC,EAAEC,eAAe,EAAE,GAAK;eAAIA;YAAiBJ;SAAsB;AAChF,GAAE"}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../src/transforms/migrate-versions-default/index.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../src/transforms/remove-versions-true/index.test.ts"],"names":[],"mappings":""}
|