From 074e3757940789049b0062191b4a8ed45b3dc94c Mon Sep 17 00:00:00 2001 From: John Pham Date: Fri, 27 Oct 2023 09:50:24 -0700 Subject: [PATCH 1/2] Make sure types work for all type resolution types --- packages/next/.npmignore | 1 + packages/next/dist/font.d.ts | 35 +---------------------------------- packages/next/font.d.ts | 34 ++++++++++++++++++++++++++++++++++ packages/next/package.json | 11 +++++++++-- 4 files changed, 45 insertions(+), 36 deletions(-) create mode 100644 packages/next/font.d.ts diff --git a/packages/next/.npmignore b/packages/next/.npmignore index 9ff305ca..29bbeee4 100644 --- a/packages/next/.npmignore +++ b/packages/next/.npmignore @@ -1,2 +1,3 @@ * !dist/**/* +!font.d.ts diff --git a/packages/next/dist/font.d.ts b/packages/next/dist/font.d.ts index 05c7ff24..dd9f2671 100644 --- a/packages/next/dist/font.d.ts +++ b/packages/next/dist/font.d.ts @@ -1,34 +1 @@ -import { NextFontWithVariable } from "@next/font"; - -declare module "geist/font" { - /** - * Geist Sans font, with `className` and `variable` properties, - * meant to be attached to DOM elements via `className` - * - * Included weights: 100, 200, 300, 400, 500, 600, 700, 800, 900 - * - * * {@link https://www.npmjs.com/package/geist?activeTab=readme#app-router View App Router Example} - * - * * {@link https://www.npmjs.com/package/geist?activeTab=readme#with-tailwind-css View Tailwind Example} - * - * * {@link https://www.npmjs.com/package/geist?activeTab=readme#pages-router View Pages Router Example} - * - * * {@link https://github.com/vercel/geist-font/releases Download Font Files} - */ - export const GeistSans: NextFontWithVariable; - /** - * Geist Mono font, with `className` and `variable` properties, - * meant to be attached to DOM elements via `className` - * - * Included weights: 100, 200, 300, 400, 500, 600, 700, 800, 900 - * - * * {@link https://www.npmjs.com/package/geist?activeTab=readme#app-router View App Router Example} - * - * * {@link https://www.npmjs.com/package/geist?activeTab=readme#with-tailwind-css View Tailwind Example} - * - * * {@link https://www.npmjs.com/package/geist?activeTab=readme#pages-router View Pages Router Example} - * - * * {@link https://github.com/vercel/geist-font/releases Download Font Files} - */ - export const GeistMono: NextFontWithVariable; -} +export * from "../font"; diff --git a/packages/next/font.d.ts b/packages/next/font.d.ts new file mode 100644 index 00000000..05c7ff24 --- /dev/null +++ b/packages/next/font.d.ts @@ -0,0 +1,34 @@ +import { NextFontWithVariable } from "@next/font"; + +declare module "geist/font" { + /** + * Geist Sans font, with `className` and `variable` properties, + * meant to be attached to DOM elements via `className` + * + * Included weights: 100, 200, 300, 400, 500, 600, 700, 800, 900 + * + * * {@link https://www.npmjs.com/package/geist?activeTab=readme#app-router View App Router Example} + * + * * {@link https://www.npmjs.com/package/geist?activeTab=readme#with-tailwind-css View Tailwind Example} + * + * * {@link https://www.npmjs.com/package/geist?activeTab=readme#pages-router View Pages Router Example} + * + * * {@link https://github.com/vercel/geist-font/releases Download Font Files} + */ + export const GeistSans: NextFontWithVariable; + /** + * Geist Mono font, with `className` and `variable` properties, + * meant to be attached to DOM elements via `className` + * + * Included weights: 100, 200, 300, 400, 500, 600, 700, 800, 900 + * + * * {@link https://www.npmjs.com/package/geist?activeTab=readme#app-router View App Router Example} + * + * * {@link https://www.npmjs.com/package/geist?activeTab=readme#with-tailwind-css View Tailwind Example} + * + * * {@link https://www.npmjs.com/package/geist?activeTab=readme#pages-router View Pages Router Example} + * + * * {@link https://github.com/vercel/geist-font/releases Download Font Files} + */ + export const GeistMono: NextFontWithVariable; +} diff --git a/packages/next/package.json b/packages/next/package.json index c4313916..64aa7b45 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -1,8 +1,11 @@ { "name": "geist", - "version": "1.0.0", + "version": "0.1.37", "description": "Geist is a new font family for Vercel, created by Vercel in collaboration with Basement Studio.", "main": "./dist/font.js", + "module": "./dist/font.js", + "typings": "font.d.ts", + "types": "font.d.ts", "scripts": { "prepare": "cp ../../LICENSE.TXT ." }, @@ -22,7 +25,11 @@ "vercel font" ], "exports": { - "./font": "./dist/font.js" + "./font": { + "import": "./dist/font.js", + "require": "./dist/font.js", + "default": "./dist/index.d.ts" + } }, "license": "SIL OPEN FONT LICENSE", "dependencies": { From ee39a3335f4d1ae3477347239664d996c3aa721e Mon Sep 17 00:00:00 2001 From: John Pham Date: Fri, 27 Oct 2023 09:52:13 -0700 Subject: [PATCH 2/2] undo version change --- packages/next/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/next/package.json b/packages/next/package.json index 64aa7b45..d722eb53 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -1,6 +1,6 @@ { "name": "geist", - "version": "0.1.37", + "version": "1.0.0", "description": "Geist is a new font family for Vercel, created by Vercel in collaboration with Basement Studio.", "main": "./dist/font.js", "module": "./dist/font.js",