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

Utilities for updating headers in _headers and vercel.json #36

Merged
merged 19 commits into from
Apr 29, 2024
Merged

Conversation

jackdbd
Copy link
Owner

@jackdbd jackdbd commented Apr 22, 2024

This PR introduces a new package hosting-utils. This package contains functions that can parse _headers files and add/update headers to it. It also contains functions to add/update headers in serve.json and vercel.json.

  • _headers. This file is used to attach/detach custom HTTP response headers for projects hosted on Cloudflare Pages.
  • vercel.json. This file is used to set custom HTTP response headers for projects hosted on Vercel.

Since code in hosting-utils is not Eleventy-specific, I might move it to a standalone repo sooner or later.

Copy link

changeset-bot bot commented Apr 22, 2024

⚠️ No Changeset found

Latest commit: b239d86

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

Copy link

socket-security bot commented Apr 22, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@11ty/eleventy-fetch@4.0.1 environment, filesystem, network 0 14.8 kB zachleat
npm/@11ty/eleventy@3.0.0-alpha.6 environment Transitive: filesystem, network, shell +20 1.74 MB zachleat
npm/@aws-sdk/client-s3@3.556.0 Transitive: environment, filesystem, network, shell +94 7.77 MB aws-sdk-bot
npm/@aws-sdk/lib-storage@3.556.0 filesystem Transitive: environment, network +25 1.17 MB aws-sdk-bot
npm/@commitlint/cli@19.2.2 Transitive: environment, eval, filesystem, shell, unsafe +47 4.56 MB escapedcat
npm/@commitlint/config-conventional@19.2.2 Transitive: filesystem +7 2.13 MB escapedcat
npm/@google-cloud/storage@7.10.1 environment, filesystem +10 2.1 MB google-wombot
npm/@google-cloud/text-to-speech@5.2.0 environment 0 2.43 MB google-wombot
npm/@jackdbd/content-security-policy@3.0.0-canary.1 Transitive: filesystem +4 171 kB jackdbd
npm/@jackdbd/zod-to-doc@1.1.1 Transitive: environment +1 79.5 kB jackdbd
npm/@microsoft/api-documenter@7.24.2 Transitive: environment, filesystem, shell, unsafe +11 8.32 MB odspnpm
npm/@microsoft/api-extractor@7.43.1 Transitive: environment, filesystem, shell, unsafe +17 41.9 MB odspnpm
npm/@reporters/github@1.7.0 environment Transitive: filesystem, network +2 155 kB molow
npm/@thi.ng/transclude@0.1.87 Transitive: environment +15 1.2 MB thi.ng
npm/@types/proper-lockfile@4.1.4 None +1 13.4 kB types
npm/@typescript-eslint/eslint-plugin@7.7.1 None +16 6.76 MB jameshenry
npm/eslint@9.1.1 environment, filesystem Transitive: eval, shell, unsafe +25 6.06 MB eslintbot

🚮 Removed packages: npm/@11ty/eleventy-fetch@4.0.0, npm/@11ty/eleventy@3.0.0-alpha.4, npm/@aws-sdk/client-s3@3.507.0, npm/@aws-sdk/lib-storage@3.507.0, npm/@commitlint/cli@18.6.0, npm/@commitlint/config-conventional@18.6.0, npm/@google-cloud/storage@7.7.0, npm/@google-cloud/text-to-speech@5.0.2, npm/@jackdbd/content-security-policy@2.1.3, npm/@jackdbd/zod-schemas@2.1.0, npm/@jackdbd/zod-to-doc@1.0.7, npm/@microsoft/api-documenter@7.23.20, npm/@microsoft/api-extractor@7.39.4, npm/@thi.ng/transclude@0.1.63, npm/@typescript-eslint/eslint-plugin@6.21.0, npm/eslint@8.56.0

View full report↗︎

Copy link

codecov bot commented Apr 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.81%. Comparing base (73ef88e) to head (b239d86).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #36      +/-   ##
==========================================
- Coverage   97.45%   95.81%   -1.65%     
==========================================
  Files          22       17       -5     
  Lines        1967     1362     -605     
  Branches       26       15      -11     
==========================================
- Hits         1917     1305     -612     
- Misses         50       57       +7     
Flag Coverage Δ
eleventy-plugin-content-security-policy ?
eleventy-plugin-permissions-policy ?
eleventy-plugin-telegram 93.01% <ø> (-2.48%) ⬇️
eleventy-plugin-text-to-speech 95.81% <ø> (-1.65%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

cloudflare-workers-and-pages bot commented Apr 23, 2024

Deploying undici with  Cloudflare Pages  Cloudflare Pages

Latest commit: b239d86
Status:🚫  Build failed.

View logs

@jackdbd jackdbd force-pushed the canary branch 2 times, most recently from 0dcc70b to b46445e Compare April 23, 2024 19:15
…p ci]

## @jackdbd/eleventy-plugin-ensure-env-vars [1.2.0-canary.1](https://github.com/jackdbd/undici/compare/@jackdbd/eleventy-plugin-ensure-env-vars@1.1.1...@jackdbd/eleventy-plugin-ensure-env-vars@1.2.0-canary.1) (2024-04-23)

### Features

* **eleventy-plugin-content-security-policy:** generate header rules in vercel.json ([90b4a5e](90b4a5e))
* **hosting-utils:** add package ([19d3456](19d3456))
## @jackdbd/eleventy-plugin-plausible [1.2.0-canary.1](https://github.com/jackdbd/undici/compare/@jackdbd/eleventy-plugin-plausible@1.1.0...@jackdbd/eleventy-plugin-plausible@1.2.0-canary.1) (2024-04-23)

### Features

* **eleventy-plugin-content-security-policy:** generate header rules in vercel.json ([90b4a5e](90b4a5e))
* **hosting-utils:** add package ([19d3456](19d3456))
## @jackdbd/eleventy-plugin-telegram [2.2.0-canary.1](https://github.com/jackdbd/undici/compare/@jackdbd/eleventy-plugin-telegram@2.1.0...@jackdbd/eleventy-plugin-telegram@2.2.0-canary.1) (2024-04-23)

### Features

* **eleventy-plugin-content-security-policy:** generate header rules in vercel.json ([90b4a5e](90b4a5e))
* **hosting-utils:** add package ([19d3456](19d3456))
… ci]

## @jackdbd/eleventy-plugin-text-to-speech [3.2.0-canary.1](https://github.com/jackdbd/undici/compare/@jackdbd/eleventy-plugin-text-to-speech@3.1.0...@jackdbd/eleventy-plugin-text-to-speech@3.2.0-canary.1) (2024-04-23)

### Features

* **eleventy-plugin-content-security-policy:** generate header rules in vercel.json ([90b4a5e](90b4a5e))
* **hosting-utils:** add package ([19d3456](19d3456))
@jackdbd jackdbd changed the title [WIP] Generate header rules in vercel.json for various 11ty plugin Various 11ty plugins output header rules in _headers and vercel.json Apr 23, 2024
@jackdbd jackdbd changed the title Various 11ty plugins output header rules in _headers and vercel.json 11ty plugins alter headers in _headers and vercel.json Apr 23, 2024
@jackdbd jackdbd changed the title 11ty plugins alter headers in _headers and vercel.json 11ty plugins write headers to _headers and vercel.json Apr 23, 2024
jackdbd and others added 7 commits April 23, 2024 21:45
## @jackdbd/hosting-utils 1.0.0-canary.1 (2024-04-23)

### Features

* **hosting-utils:** add package ([19d3456](19d3456))

### Bug Fixes

* **hosting-utils:** add config for semantic-release ([8c731dd](8c731dd))
## @jackdbd/text-to-audio-asset [1.2.0-canary.1](https://github.com/jackdbd/undici/compare/@jackdbd/text-to-audio-asset@1.1.0...@jackdbd/text-to-audio-asset@1.2.0-canary.1) (2024-04-23)

### Features

* **eleventy-plugin-content-security-policy:** generate header rules in vercel.json ([90b4a5e](90b4a5e))
…y.1 [skip ci]

## @jackdbd/eleventy-plugin-content-security-policy [2.2.0-canary.1](https://github.com/jackdbd/undici/compare/@jackdbd/eleventy-plugin-content-security-policy@2.1.2...@jackdbd/eleventy-plugin-content-security-policy@2.2.0-canary.1) (2024-04-23)

### Features

* **eleventy-plugin-content-security-policy:** add tests ([c6df47f](c6df47f))
* **eleventy-plugin-content-security-policy:** generate header rules in vercel.json ([90b4a5e](90b4a5e))
* **hosting-utils:** add package ([19d3456](19d3456))

### Dependencies

* **@jackdbd/hosting-utils:** upgraded to 1.0.0-canary.1
…skip ci]

## @jackdbd/eleventy-plugin-permissions-policy [1.2.0-canary.1](https://github.com/jackdbd/undici/compare/@jackdbd/eleventy-plugin-permissions-policy@1.1.1...@jackdbd/eleventy-plugin-permissions-policy@1.2.0-canary.1) (2024-04-23)

### Features

* **eleventy-plugin-content-security-policy:** generate header rules in vercel.json ([90b4a5e](90b4a5e))
* **hosting-utils:** add package ([19d3456](19d3456))

### Dependencies

* **@jackdbd/hosting-utils:** upgraded to 1.0.0-canary.1
jackdbd and others added 3 commits April 26, 2024 15:28
## @jackdbd/permissions-policy 1.0.0-canary.1 (2024-04-26)

### Features

* **permissions-policy:** add package ([2e9c396](2e9c396))
@jackdbd jackdbd changed the title 11ty plugins write headers to _headers and vercel.json Utilities for updating headers in _headers and vercel.json Apr 29, 2024
@jackdbd jackdbd merged commit 456dd54 into main Apr 29, 2024
9 of 13 checks passed
@jackdbd
Copy link
Owner Author

jackdbd commented Apr 29, 2024

🎉 This PR is included in version 1.2.0 🎉

The release is available on @jackdbd/eleventy-plugin-ensure-env-vars@1.2.0

Your semantic-release bot 📦🚀

@jackdbd
Copy link
Owner Author

jackdbd commented Apr 29, 2024

🎉 This PR is included in version 1.2.0 🎉

The release is available on @jackdbd/eleventy-plugin-plausible@1.2.0

Your semantic-release bot 📦🚀

@jackdbd
Copy link
Owner Author

jackdbd commented Apr 29, 2024

🎉 This PR is included in version 2.2.0 🎉

The release is available on @jackdbd/eleventy-plugin-telegram@2.2.0

Your semantic-release bot 📦🚀

@jackdbd
Copy link
Owner Author

jackdbd commented Apr 29, 2024

🎉 This PR is included in version 3.2.0 🎉

The release is available on @jackdbd/eleventy-plugin-text-to-speech@3.2.0

Your semantic-release bot 📦🚀

@jackdbd
Copy link
Owner Author

jackdbd commented Apr 29, 2024

🎉 This PR is included in version 1.0.0 🎉

The release is available on @jackdbd/hosting-utils@1.0.0

Your semantic-release bot 📦🚀

@jackdbd
Copy link
Owner Author

jackdbd commented Apr 29, 2024

🎉 This PR is included in version 1.2.0 🎉

The release is available on @jackdbd/text-to-audio-asset@1.2.0

Your semantic-release bot 📦🚀

@jackdbd
Copy link
Owner Author

jackdbd commented Apr 29, 2024

🎉 This PR is included in version 2.2.0 🎉

The release is available on @jackdbd/eleventy-plugin-content-security-policy@2.2.0

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants