Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/renderers/contentful/renderDefaultLocale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ export default function renderDefaultLocale(locales: Locale[]): string {
throw new Error("Could not find a default locale in Contentful.")
}

return `type CONTENTFUL_DEFAULT_LOCALE_CODE = '${defaultLocale.code}';`
return `export type CONTENTFUL_DEFAULT_LOCALE_CODE = '${defaultLocale.code}';`
}
2 changes: 1 addition & 1 deletion src/renderers/typescript/renderUnion.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default function renderUnion(name: string, values: string[]): string {
return `
type ${name} = ${renderUnionValues(values)};
export type ${name} = ${renderUnionValues(values)};
`
}

Expand Down
2 changes: 1 addition & 1 deletion test/renderers/contentful/renderAllLocales.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe("renderSymbol()", () => {

it("works with a list of locales", () => {
expect(format(renderAllLocales(locales))).toMatchInlineSnapshot(
`"type LOCALE_CODE = \\"en-US\\" | \\"pt-BR\\";"`,
`"export type LOCALE_CODE = \\"en-US\\" | \\"pt-BR\\";"`,
)
})
})
2 changes: 1 addition & 1 deletion test/renderers/contentful/renderDefaultLocale.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe("renderSymbol()", () => {

it("works with a list of locales", () => {
expect(format(renderDefaultLocale(locales))).toMatchInlineSnapshot(
`"type CONTENTFUL_DEFAULT_LOCALE_CODE = \\"en-US\\";"`,
`"export type CONTENTFUL_DEFAULT_LOCALE_CODE = \\"en-US\\";"`,
)
})

Expand Down
6 changes: 3 additions & 3 deletions test/renderers/render.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ describe("render()", () => {
}
}

type CONTENT_TYPE = \\"myContentType\\"
export type CONTENT_TYPE = \\"myContentType\\"

type LOCALE_CODE = \\"en-US\\" | \\"pt-BR\\"
export type LOCALE_CODE = \\"en-US\\" | \\"pt-BR\\"

type CONTENTFUL_DEFAULT_LOCALE_CODE = \\"en-US\\"
export type CONTENTFUL_DEFAULT_LOCALE_CODE = \\"en-US\\"
"
`)
})
Expand Down
2 changes: 1 addition & 1 deletion test/renderers/typescript/renderUnion.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import format from "../../support/format"
describe("renderUnion()", () => {
it("renders a union", () => {
expect(format(renderUnion("name", ["1", "2", "3"]))).toMatchInlineSnapshot(
`"type name = 1 | 2 | 3;"`,
`"export type name = 1 | 2 | 3;"`,
)
})
})
Expand Down