From 3ebde718f4c2b56b39d254f609f873b15745f004 Mon Sep 17 00:00:00 2001 From: Jamie B <53781962+JamieB-gu@users.noreply.github.com> Date: Mon, 30 Nov 2020 13:15:17 +0000 Subject: [PATCH] Bumped `@guardian/types` to v1.0.0 - Updated imports to use new `@guardian/types` exports - Added `@guardian/types` as a `peerDependency` --- package-lock.json | 9 ++++++--- package.json | 5 ++++- src/components/bodyImage.stories.tsx | 3 +-- src/components/bodyImage.tsx | 5 ++--- src/components/figCaption.stories.tsx | 3 +-- src/components/figCaption.tsx | 6 ++---- src/components/img.stories.tsx | 3 +-- src/components/img.tsx | 6 ++---- src/editorialPalette.ts | 4 ++-- src/fixtures/image.ts | 2 +- src/image.ts | 2 +- src/lightbox.ts | 4 ++-- 12 files changed, 25 insertions(+), 27 deletions(-) diff --git a/package-lock.json b/package-lock.json index 835b7fc..4ec6c9b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2326,8 +2326,8 @@ "integrity": "sha512-r1eUesgetq0jJc0vt1f+b07PtkQ44AzytsW1tGmdirtthF28FBWoVJ5QcFcebL/Ou47xNQi+BhqC8VKbjMFbrg==" }, "@guardian/types": { - "version": "github:guardian/types#da18ca13c822c9eed91ec9b6722c344c6f8088b4", - "from": "github:guardian/types#semver:^0.5.2", + "version": "github:guardian/types#7c57081d48d517392e4eb7492ece393076fbeaf1", + "from": "github:guardian/types#semver:^1.0.0", "requires": { "typescript": "^3.8.3" }, @@ -3395,7 +3395,8 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true + "dev": true, + "optional": true }, "is-glob": { "version": "4.0.1", @@ -3412,6 +3413,7 @@ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", "dev": true, + "optional": true, "requires": { "arr-diff": "^4.0.0", "array-unique": "^0.3.2", @@ -20352,6 +20354,7 @@ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", "dev": true, + "optional": true, "requires": { "arr-diff": "^4.0.0", "array-unique": "^0.3.2", diff --git a/package.json b/package.json index c16fa67..6e8596f 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "dependencies": { "@emotion/core": "^10.1.1", "@guardian/src-foundations": "^2.6.0", - "@guardian/types": "github:guardian/types#semver:^0.5.2", + "@guardian/types": "github:guardian/types#semver:^1.0.0", "react": "^16.14.0", "react-dom": "^16.14.0", "typescript": "^4.0.5" @@ -40,6 +40,9 @@ "ts-jest": "^26.4.4", "ts-loader": "^8.0.11" }, + "peerDependencies": { + "@guardian/types": "1.x" + }, "scripts": { "preinstall": "[ -z \"$CI\" ] || if [[ $npm_execpath =~ 'yarn' ]]; then echo 'Use NPM!' && exit 1; fi", "build": "npm run build:tsc && npm run build:babel && npm run build:cleanup", diff --git a/src/components/bodyImage.stories.tsx b/src/components/bodyImage.stories.tsx index ca80756..b70c2e7 100644 --- a/src/components/bodyImage.stories.tsx +++ b/src/components/bodyImage.stories.tsx @@ -2,8 +2,7 @@ // ----- Imports ----- // -import { Design, Display, Pillar } from "@guardian/types/Format"; -import { none, some } from "@guardian/types/option"; +import { Design, Display, none, Pillar, some } from "@guardian/types"; import type { FC } from "react"; import React from "react"; import { image } from "../fixtures/image"; diff --git a/src/components/bodyImage.tsx b/src/components/bodyImage.tsx index 0c36b61..e386cb0 100644 --- a/src/components/bodyImage.tsx +++ b/src/components/bodyImage.tsx @@ -5,9 +5,8 @@ import { css } from "@emotion/core"; import { remSpace } from "@guardian/src-foundations"; import type { Breakpoint } from "@guardian/src-foundations/mq"; import { from } from "@guardian/src-foundations/mq"; -import type { Format } from "@guardian/types/Format"; -import type { Option } from "@guardian/types/option"; -import { none, some, withDefault } from "@guardian/types/option"; +import type { Format, Option } from "@guardian/types"; +import { none, some, withDefault } from "@guardian/types"; import React from "react"; import type { FC, ReactNode } from "react"; import type { Image } from "../image"; diff --git a/src/components/figCaption.stories.tsx b/src/components/figCaption.stories.tsx index bdaac86..4eee6bd 100644 --- a/src/components/figCaption.stories.tsx +++ b/src/components/figCaption.stories.tsx @@ -2,8 +2,7 @@ // ----- Imports ----- // -import { Design, Display, Pillar } from "@guardian/types/Format"; -import { some } from "@guardian/types/option"; +import { Design, Display, Pillar, some } from "@guardian/types"; import type { FC } from "react"; import React from "react"; import { FigCaption } from "./figCaption"; diff --git a/src/components/figCaption.tsx b/src/components/figCaption.tsx index 45a38d5..f0d6548 100644 --- a/src/components/figCaption.tsx +++ b/src/components/figCaption.tsx @@ -5,10 +5,8 @@ import { css } from "@emotion/core"; import { remSpace } from "@guardian/src-foundations"; import { neutral, text } from "@guardian/src-foundations/palette"; import { textSans } from "@guardian/src-foundations/typography"; -import type { Format } from "@guardian/types/Format"; -import { Design } from "@guardian/types/Format"; -import type { Option } from "@guardian/types/option"; -import { OptionKind } from "@guardian/types/option"; +import type { Format, Option } from "@guardian/types"; +import { Design, OptionKind } from "@guardian/types"; import React from "react"; import type { FC, ReactNode } from "react"; import { fill } from "../editorialPalette"; diff --git a/src/components/img.stories.tsx b/src/components/img.stories.tsx index c8a7406..fc089ae 100644 --- a/src/components/img.stories.tsx +++ b/src/components/img.stories.tsx @@ -2,8 +2,7 @@ // ----- Imports ----- // -import { Design, Display, Pillar } from "@guardian/types/Format"; -import { none } from "@guardian/types/option"; +import { Design, Display, none, Pillar } from "@guardian/types"; import type { FC } from "react"; import React from "react"; import { image } from "../fixtures/image"; diff --git a/src/components/img.tsx b/src/components/img.tsx index c1f9843..4296d77 100644 --- a/src/components/img.tsx +++ b/src/components/img.tsx @@ -3,10 +3,8 @@ import type { SerializedStyles } from "@emotion/core"; import { css } from "@emotion/core"; import { neutral } from "@guardian/src-foundations/palette"; -import type { Format } from "@guardian/types/Format"; -import { Design } from "@guardian/types/Format"; -import type { Option } from "@guardian/types/option"; -import { withDefault } from "@guardian/types/option"; +import type { Format, Option } from "@guardian/types"; +import { Design, withDefault } from "@guardian/types"; import React from "react"; import type { FC } from "react"; import type { Image } from "../image"; diff --git a/src/editorialPalette.ts b/src/editorialPalette.ts index 50f1563..de0a9c2 100644 --- a/src/editorialPalette.ts +++ b/src/editorialPalette.ts @@ -8,8 +8,8 @@ import { specialReport, sport, } from "@guardian/src-foundations/palette"; -import type { Format } from "@guardian/types/Format"; -import { Pillar, Special } from "@guardian/types/Format"; +import type { Format } from "@guardian/types"; +import { Pillar, Special } from "@guardian/types"; // ----- Types ----- // diff --git a/src/fixtures/image.ts b/src/fixtures/image.ts index a11b57a..f84444d 100644 --- a/src/fixtures/image.ts +++ b/src/fixtures/image.ts @@ -1,6 +1,6 @@ // ----- Imports ----- // -import { some } from "@guardian/types/option"; +import { some } from "@guardian/types"; import type { Image } from "../image"; import { Role } from "../image"; diff --git a/src/image.ts b/src/image.ts index 413477d..79bf1bb 100644 --- a/src/image.ts +++ b/src/image.ts @@ -1,6 +1,6 @@ // ----- Imports ----- // -import type { Option } from "@guardian/types/option"; +import type { Option } from "@guardian/types"; // ----- Types ----- // diff --git a/src/lightbox.ts b/src/lightbox.ts index 01e4bd8..ec64fd4 100644 --- a/src/lightbox.ts +++ b/src/lightbox.ts @@ -1,7 +1,7 @@ // ----- Imports ----- // -import type { Option } from "@guardian/types/option"; -import { OptionKind } from "@guardian/types/option"; +import type { Option } from "@guardian/types"; +import { OptionKind } from "@guardian/types"; // ----- Types ----- //