diff --git a/src/renderers/render.ts b/src/renderers/render.ts index a9558737..6b056eef 100644 --- a/src/renderers/render.ts +++ b/src/renderers/render.ts @@ -24,7 +24,6 @@ export default async function render( const sortedLocales = locales.sort((a, b) => a.code.localeCompare(b.code)) const typingsSource = [ - renderContentfulImports(localization), renderAllContentTypes(sortedContentTypes, localization), renderAllContentTypeIds(sortedContentTypes), renderAllLocales(sortedLocales), @@ -32,7 +31,10 @@ export default async function render( renderLocalizedTypes(localization), ].join("\n\n") - const source = [renderContentfulImports(), renderNamespace(typingsSource, namespace)].join("\n\n") + const source = [ + renderContentfulImports(localization), + renderNamespace(typingsSource, namespace), + ].join("\n\n") const prettierConfig = await resolveConfig(process.cwd()) return format(source, { ...prettierConfig, parser: "typescript" }) diff --git a/test/renderers/render.test.ts b/test/renderers/render.test.ts index c7f4ba5c..384ef2d0 100644 --- a/test/renderers/render.test.ts +++ b/test/renderers/render.test.ts @@ -58,11 +58,6 @@ describe("render()", () => { import { Asset, Entry } from \\"contentful\\" import { Document } from \\"@contentful/rich-text-types\\" - // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT MODIFY IT. - - import { Asset, Entry } from \\"contentful\\" - import { Document } from \\"@contentful/rich-text-types\\" - export interface IMyContentTypeFields { /** Array field */ arrayField: (\\"one\\" | \\"of\\" | \\"the\\" | \\"above\\")[] @@ -130,11 +125,6 @@ describe("render()", () => { expect(await render(contentTypes, locales, { localization: true })).toMatchInlineSnapshot(` "// THIS FILE IS AUTOMATICALLY GENERATED. DO NOT MODIFY IT. - import { Asset, Entry } from \\"contentful\\" - import { Document } from \\"@contentful/rich-text-types\\" - - // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT MODIFY IT. - import { Entry } from \\"contentful\\" import { Document } from \\"@contentful/rich-text-types\\" @@ -201,11 +191,6 @@ describe("render()", () => { import { Document } from \\"@contentful/rich-text-types\\" declare namespace Codegen { - // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT MODIFY IT. - - import { Asset, Entry } from \\"contentful\\" - import { Document } from \\"@contentful/rich-text-types\\" - export interface IMyContentTypeFields { /** Array field */ arrayField: (\\"one\\" | \\"of\\" | \\"the\\" | \\"above\\")[]