Skip to content

Commit

Permalink
Update imports to use local copy of article format types
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmockett committed Oct 3, 2024
1 parent 1994d2f commit c8858f9
Show file tree
Hide file tree
Showing 195 changed files with 1,017 additions and 936 deletions.
10 changes: 7 additions & 3 deletions apps-rendering/src/adSlot.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
// ----- Imports ----- //

import type { ArticleFormat } from '@guardian/libs';
import { ArticleDesign, ArticleDisplay, ArticlePillar } from '@guardian/libs';
import {
ArticleDesign,
ArticleDisplay,
type ArticleFormat,
Pillar,
} from 'articleFormat';
import AdSlot from 'adSlot';
import type { ReactElement } from 'react';

// ----- Stories ----- //

const mockFormat: ArticleFormat = {
theme: ArticlePillar.News,
theme: Pillar.News,
design: ArticleDesign.Standard,
display: ArticleDisplay.Standard,
};
Expand Down
2 changes: 1 addition & 1 deletion apps-rendering/src/adSlot.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { SerializedStyles } from '@emotion/react';
import { css, ThemeProvider } from '@emotion/react';
import type { ArticleFormat } from '@guardian/libs';
import type { ArticleFormat } from 'articleFormat';
import {
from,
headlineMedium17,
Expand Down
2 changes: 1 addition & 1 deletion apps-rendering/src/ads.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ArticleFormat } from '@guardian/libs';
import type { ArticleFormat } from 'articleFormat';
import AdSlot from 'adSlot';
import Paragraph from 'components/Paragraph';
import type { ReactNode } from 'react';
Expand Down
4 changes: 2 additions & 2 deletions apps-rendering/src/articleFormat.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ----- Imports ----- //

import { ArticleDesign, ArticleDisplay, ArticlePillar } from '@guardian/libs';
import { ArticleDesign, ArticleDisplay, Pillar } from 'articleFormat';
import { formatToString } from 'articleFormat';

// ----- Tests ----- //
Expand All @@ -10,7 +10,7 @@ describe('formatToString', () => {
const format = formatToString({
design: ArticleDesign.Standard,
display: ArticleDisplay.Immersive,
theme: ArticlePillar.Culture,
theme: Pillar.Culture,
});

expect(format).toBe(
Expand Down
2 changes: 1 addition & 1 deletion apps-rendering/src/bodyElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { Newsletter } from '@guardian/apps-rendering-api-models/newsletter'
import type { Atoms } from '@guardian/content-api-models/v1/atoms';
import type { BlockElement } from '@guardian/content-api-models/v1/blockElement';
import { ElementType } from '@guardian/content-api-models/v1/elementType';
import type { ArticleTheme } from '@guardian/libs';
import type { ArticleTheme } from 'articleFormat';
import type { Option } from '../vendor/@guardian/types/index';
import { fromNullable } from '../vendor/@guardian/types/index';
import type { TimelineEvent } from 'atoms';
Expand Down
2 changes: 1 addition & 1 deletion apps-rendering/src/campaign.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { Campaign } from '@guardian/apps-rendering-api-models/campaign';
import { CampaignFields } from '@guardian/apps-rendering-api-models/campaignFields';
import { ParticipationFields } from '@guardian/apps-rendering-api-models/participationFields';
import { ArticleSpecial } from '@guardian/libs';
import { ArticleSpecial } from 'articleFormat';
import { Int64 } from 'thrift';
import { getCallout, getReport } from 'campaign';

Expand Down
2 changes: 1 addition & 1 deletion apps-rendering/src/campaign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import type { Campaign } from '@guardian/apps-rendering-api-models/campaign';
import type { ParticipationFields } from '@guardian/apps-rendering-api-models/participationFields';
import { ArticleSpecial } from '@guardian/libs';
import { ArticleSpecial } from 'articleFormat';
import { Optional } from 'optional';

export type CalloutFields = {
Expand Down
8 changes: 6 additions & 2 deletions apps-rendering/src/client/callouts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@
import type { Contact } from '@guardian/apps-rendering-api-models/contact';
import type { FormField } from '@guardian/apps-rendering-api-models/formField';
import type { FormOption } from '@guardian/apps-rendering-api-models/formOption';
import { ArticleSpecial, Pillar } from '@guardian/libs';
import type { ArticleFormat, ArticleTheme } from '@guardian/libs';
import {
type ArticleFormat,
ArticleSpecial,
type ArticleTheme,
Pillar,
} from 'articleFormat';
import { withDefault } from '../../vendor/@guardian/types/index';
import { ElementKind } from 'bodyElementKind';
import { pipe, resultFromNullable } from 'lib';
Expand Down
4 changes: 2 additions & 2 deletions apps-rendering/src/components/Anchor/Anchor.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ----- Imports ----- //

import { ArticleDesign, ArticleDisplay, ArticlePillar } from '@guardian/libs';
import { ArticleDesign, ArticleDisplay, Pillar } from '../../articleFormat';
import { getAllThemes, getThemeNameAsString } from 'fixtures/article';
import Anchor from './';

Expand All @@ -16,7 +16,7 @@ const Default = () => (
format={{
design: ArticleDesign.Standard,
display: ArticleDisplay.Standard,
theme: ArticlePillar.News,
theme: Pillar.News,
}}
href={link}
>
Expand Down
7 changes: 5 additions & 2 deletions apps-rendering/src/components/Anchor/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

import type { SerializedStyles } from '@emotion/react';
import { css } from '@emotion/react';
import type { ArticleFormat } from '@guardian/libs';
import { ArticleDesign, ArticleSpecial } from '@guardian/libs';
import {
ArticleDesign,
type ArticleFormat,
ArticleSpecial,
} from '../../articleFormat';
import { labs, neutral } from '@guardian/source/foundations';
import { text } from 'palette';
import type { ReactNode } from 'react';
Expand Down
2 changes: 1 addition & 1 deletion apps-rendering/src/components/ArticleBody/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { SerializedStyles } from '@emotion/react';
import { css } from '@emotion/react';
import type { ArticleFormat } from '@guardian/libs';
import type { ArticleFormat } from '../../articleFormat';
import { palette, remSpace } from '@guardian/source/foundations';
import type { BodyElement } from 'bodyElement';
import { background } from 'palette';
Expand Down
2 changes: 1 addition & 1 deletion apps-rendering/src/components/Avatar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import type { SerializedStyles } from '@emotion/react';
import { css } from '@emotion/react';
import type { ArticleFormat } from '@guardian/libs';
import type { ArticleFormat } from '../../articleFormat';
import { remSpace } from '@guardian/source/foundations';
import { map, withDefault } from '../../../vendor/@guardian/types/index';
import Img from 'components/Img';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { ArticleDesign, ArticleDisplay, ArticlePillar } from '@guardian/libs';
import { ArticleDesign, ArticleDisplay, Pillar } from '../../articleFormat';
import Paragraph from 'components/Paragraph';
import Blockquote from './';

const standard = {
design: ArticleDesign.Standard,
display: ArticleDisplay.Standard,
theme: ArticlePillar.News,
theme: Pillar.News,
};

const Default = () => (
Expand Down
2 changes: 1 addition & 1 deletion apps-rendering/src/components/Blockquote/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import type { SerializedStyles } from '@emotion/react';
import { css } from '@emotion/react';
import type { ArticleFormat } from '@guardian/libs';
import type { ArticleFormat } from '../../articleFormat';
import { remSpace } from '@guardian/source/foundations';
import { fill } from 'palette';
import type { ReactNode } from 'react';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import type { SerializedStyles } from '@emotion/react';
import { css } from '@emotion/react';
import { ArticleElementRole } from '@guardian/libs';
import type { ArticleFormat } from '@guardian/libs';
import type { ArticleFormat } from '../../articleFormat';
import { from, remSpace } from '@guardian/source/foundations';
import type { Breakpoint } from '@guardian/source/foundations';
import type { Option } from '../../../vendor/@guardian/types/index';
Expand Down
10 changes: 3 additions & 7 deletions apps-rendering/src/components/BodyImage/BodyImage.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
// ----- Imports ----- //

import {
ArticleDesign,
ArticleDisplay,
ArticleElementRole,
ArticlePillar,
} from '@guardian/libs';
import { ArticleElementRole } from '@guardian/libs';
import { ArticleDesign, ArticleDisplay, Pillar } from '../../articleFormat';
import { none } from '../../../vendor/@guardian/types/index';
import { image } from 'fixtures/image';
import { Optional } from 'optional';
Expand All @@ -16,7 +12,7 @@ import BodyImage from '.';
const format = {
design: ArticleDesign.Standard,
display: ArticleDisplay.Standard,
theme: ArticlePillar.News,
theme: Pillar.News,
};
const caption = Optional.some(
'Age of the train … a tourist train in Switzerland. Photograph: Kisa_Markiza/Getty Images',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { SerializedStyles } from '@emotion/react';
import { css } from '@emotion/react';
import type { ArticleFormat } from '@guardian/libs';
import type { ArticleFormat } from '../../articleFormat';
import {
from,
headlineMedium17,
Expand Down
2 changes: 1 addition & 1 deletion apps-rendering/src/components/BodyImage/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// ----- Imports ----- //
import { ArticleDesign } from '@guardian/libs';
import { ArticleDesign } from '../../articleFormat';
import type { Breakpoint } from '@guardian/source/foundations';
import type { Option } from '../../../vendor/@guardian/types/index';
import { none } from '../../../vendor/@guardian/types/index';
Expand Down
4 changes: 2 additions & 2 deletions apps-rendering/src/components/Bullet/Bullet.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ----- Imports ----- //

import { ArticleDesign, ArticleDisplay, ArticlePillar } from '@guardian/libs';
import { ArticleDesign, ArticleDisplay, Pillar } from '../../articleFormat';
import Bullet from './';

// ----- Stories ----- //
Expand All @@ -10,7 +10,7 @@ const Default = () => (
format={{
design: ArticleDesign.Standard,
display: ArticleDisplay.Standard,
theme: ArticlePillar.News,
theme: Pillar.News,
}}
text="• Lorem ipsum"
/>
Expand Down
2 changes: 1 addition & 1 deletion apps-rendering/src/components/Bullet/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import type { SerializedStyles } from '@emotion/react';
import { css } from '@emotion/react';
import type { ArticleFormat } from '@guardian/libs';
import type { ArticleFormat } from '../../articleFormat';
import { background } from 'palette';
import { darkModeCss } from 'styles';

Expand Down
2 changes: 1 addition & 1 deletion apps-rendering/src/components/Byline/AnalysisByline.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { SerializedStyles } from '@emotion/react';
import { css } from '@emotion/react';
import type { ArticleFormat } from '@guardian/libs';
import type { ArticleFormat } from '../../articleFormat';
import {
headlineLightItalic28,
headlineLightItalic34,
Expand Down
2 changes: 1 addition & 1 deletion apps-rendering/src/components/Byline/Byline.defaults.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { SerializedStyles } from '@emotion/react';
import { css } from '@emotion/react';
import type { ArticleFormat } from '@guardian/libs';
import type { ArticleFormat } from '../../articleFormat';
import {
headlineBold17,
headlineMediumItalic17,
Expand Down
10 changes: 5 additions & 5 deletions apps-rendering/src/components/Byline/Byline.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import {
ArticleDesign,
ArticleDisplay,
ArticlePillar,
ArticleSpecial,
} from '@guardian/libs';
Pillar,
} from '../../articleFormat';
import { parse } from 'client/parser';
import { getAllThemes, getThemeNameAsString } from 'fixtures/article';
import Byline from './';
Expand All @@ -27,7 +27,7 @@ const mockBylineHtml = parseByline(

const Default = () => (
<Byline
theme={ArticlePillar.News}
theme={Pillar.News}
design={ArticleDesign.Standard}
display={ArticleDisplay.Standard}
bylineHtml={mockBylineHtml}
Expand All @@ -36,7 +36,7 @@ const Default = () => (

const Analysis = () => (
<Byline
theme={ArticlePillar.News}
theme={Pillar.News}
design={ArticleDesign.Analysis}
display={ArticleDisplay.Standard}
bylineHtml={mockBylineHtml}
Expand All @@ -45,7 +45,7 @@ const Analysis = () => (

const Comment = () => (
<Byline
theme={ArticlePillar.Opinion}
theme={Pillar.Opinion}
design={ArticleDesign.Comment}
display={ArticleDisplay.Standard}
bylineHtml={mockBylineHtml}
Expand Down
2 changes: 1 addition & 1 deletion apps-rendering/src/components/Byline/CommentByline.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { SerializedStyles } from '@emotion/react';
import { css } from '@emotion/react';
import type { ArticleFormat } from '@guardian/libs';
import type { ArticleFormat } from '../../articleFormat';
import { between, headlineLightItalic34 } from '@guardian/source/foundations';
import type { Option } from '../../../vendor/@guardian/types/index';
import { text } from 'palette';
Expand Down
2 changes: 1 addition & 1 deletion apps-rendering/src/components/Byline/DeadBlogByline.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { css } from '@emotion/react';
import type { ArticleFormat } from '@guardian/libs';
import type { ArticleFormat } from '../../articleFormat';
import {
headlineBold17,
headlineMediumItalic17,
Expand Down
2 changes: 1 addition & 1 deletion apps-rendering/src/components/Byline/GalleryByline.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { SerializedStyles } from '@emotion/react';
import { css } from '@emotion/react';
import type { ArticleFormat } from '@guardian/libs';
import type { ArticleFormat } from '../../articleFormat';
import { headlineMediumItalic17, remSpace } from '@guardian/source/foundations';
import type { Option } from '../../../vendor/@guardian/types/index';
import { grid } from 'grid/grid';
Expand Down
2 changes: 1 addition & 1 deletion apps-rendering/src/components/Byline/LabsByline.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { css } from '@emotion/react';
import type { ArticleFormat } from '@guardian/libs';
import type { ArticleFormat } from '../../articleFormat';
import { labs, textSansItalic17 } from '@guardian/source/foundations';
import type { Option } from '../../../vendor/@guardian/types/index';
import { darkModeCss } from 'styles';
Expand Down
2 changes: 1 addition & 1 deletion apps-rendering/src/components/Byline/LiveBlogByline.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { SerializedStyles } from '@emotion/react';
import { css } from '@emotion/react';
import type { ArticleFormat } from '@guardian/libs';
import type { ArticleFormat } from '../../articleFormat';
import {
from,
headlineBold17,
Expand Down
7 changes: 5 additions & 2 deletions apps-rendering/src/components/Byline/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// ----- Imports ----- //
import { ArticleDesign, ArticleSpecial } from '@guardian/libs';
import type { ArticleFormat } from '@guardian/libs';
import {
ArticleDesign,
type ArticleFormat,
ArticleSpecial,
} from '../../articleFormat';
import type { Option } from '../../../vendor/@guardian/types/index';
import AnalysisByline from './AnalysisByline';
import {
Expand Down
2 changes: 1 addition & 1 deletion apps-rendering/src/components/BylineCard/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { SerializedStyles } from '@emotion/react';
import { css } from '@emotion/react';
import type { RelatedItem } from '@guardian/apps-rendering-api-models/relatedItem';
import type { ArticleFormat } from '@guardian/libs';
import type { ArticleFormat } from '../../articleFormat';
import {
from,
headlineMedium17,
Expand Down
10 changes: 7 additions & 3 deletions apps-rendering/src/components/Callout/Callout.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import { ArticleDesign, ArticleDisplay, ArticlePillar } from '@guardian/libs';
import type { ArticleFormat } from '@guardian/libs';
import {
ArticleDesign,
ArticleDisplay,
type ArticleFormat,
Pillar,
} from '../../articleFormat';
import fetchMock from 'fetch-mock';
import { campaignDescription, mockCampaign } from 'fixtures/campaign';
import type { ReactElement } from 'react';
import Callout from '.';

const mockFormat: ArticleFormat = {
theme: ArticlePillar.News,
theme: Pillar.News,
design: ArticleDesign.Standard,
display: ArticleDisplay.Standard,
};
Expand Down
2 changes: 1 addition & 1 deletion apps-rendering/src/components/Callout/calloutBlock.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Contact } from '@guardian/apps-rendering-api-models/contact';
import type { FormField } from '@guardian/apps-rendering-api-models/formField';
import type { ArticleFormat } from '@guardian/libs';
import type { ArticleFormat } from '../../articleFormat';
import { Tabs } from '@guardian/source-development-kitchen/react-components';
import { useState } from 'react';
import type { ReactElement } from 'react';
Expand Down
2 changes: 1 addition & 1 deletion apps-rendering/src/components/Callout/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { css, ThemeProvider } from '@emotion/react';
import type { Contact } from '@guardian/apps-rendering-api-models/contact';
import type { FormField } from '@guardian/apps-rendering-api-models/formField';
import type { ArticleFormat } from '@guardian/libs';
import type { ArticleFormat } from '../../articleFormat';
import { remSpace } from '@guardian/source/foundations';
import { ExpandingWrapper } from '@guardian/source-development-kitchen/react-components';
import { isElement } from 'lib';
Expand Down
Loading

0 comments on commit c8858f9

Please sign in to comment.