Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(fonts): config #12777

Merged
merged 13 commits into from
Jan 21, 2025
Merged

feat(fonts): config #12777

merged 13 commits into from
Jan 21, 2025

Conversation

florian-lefebvre
Copy link
Member

@florian-lefebvre florian-lefebvre commented Dec 18, 2024

This is not against main

Changes

  • Closes PLT-2718
  • Adds some preliminary code to handle passing font providers and families

Testing

Adds some types and config tests

Docs

N/A

Copy link

changeset-bot bot commented Dec 18, 2024

⚠️ No Changeset found

Latest commit: c79ed01

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions bot added pkg: astro Related to the core `astro` package (scope) docs pr labels Dec 18, 2024
@florian-lefebvre florian-lefebvre changed the title feat: setup branch feat(fonts): config Dec 18, 2024
@florian-lefebvre

This comment was marked as outdated.

@florian-lefebvre florian-lefebvre marked this pull request as ready for review January 20, 2025 14:40
Copy link
Contributor

@ascorbic ascorbic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good so far

packages/astro/src/config/index.ts Show resolved Hide resolved
packages/astro/src/core/config/schema.ts Outdated Show resolved Hide resolved

export interface FontProvider<TName extends string> {
name: TName;
entrypoint: string;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

entrypoint should be a string or a URL. Since v5, all entry points now accept URL too

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll address this in the next PR

export function adobe(config: { apiKey: string }) {
return defineFontProvider({
name: 'adobe',
entrypoint: 'astro/assets/fonts/providers/adobe',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Entrypoints should have the file extension. E.g. astro/assets/fonts/providers/adobe.js

@florian-lefebvre florian-lefebvre merged commit 95673fc into feat/fonts Jan 21, 2025
5 checks passed
@florian-lefebvre florian-lefebvre deleted the feat/fonts-config branch January 21, 2025 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs pr pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants