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/[email protected] environment, filesystem, network 0 14.8 kB zachleat
npm/@11ty/[email protected] environment Transitive: filesystem, network, shell +20 1.74 MB zachleat
npm/@aws-sdk/[email protected] Transitive: environment, filesystem, network, shell +94 7.77 MB aws-sdk-bot
npm/@aws-sdk/[email protected] filesystem Transitive: environment, network +25 1.17 MB aws-sdk-bot
npm/@commitlint/[email protected] Transitive: environment, eval, filesystem, shell, unsafe +47 4.56 MB escapedcat
npm/@commitlint/[email protected] Transitive: filesystem +7 2.13 MB escapedcat
npm/@google-cloud/[email protected] environment, filesystem +10 2.1 MB google-wombot
npm/@google-cloud/[email protected] environment 0 2.43 MB google-wombot
npm/@jackdbd/[email protected] Transitive: filesystem +4 171 kB jackdbd
npm/@jackdbd/[email protected] Transitive: environment +1 79.5 kB jackdbd
npm/@microsoft/[email protected] Transitive: environment, filesystem, shell, unsafe +11 8.32 MB odspnpm
npm/@microsoft/[email protected] Transitive: environment, filesystem, shell, unsafe +17 41.9 MB odspnpm
npm/@reporters/[email protected] environment Transitive: filesystem, network +2 155 kB molow
npm/@thi.ng/[email protected] Transitive: environment +15 1.2 MB thi.ng
npm/@types/[email protected] None +1 13.4 kB types
npm/@typescript-eslint/[email protected] None +16 6.76 MB jameshenry
npm/[email protected] environment, filesystem Transitive: eval, shell, unsafe +25 6.06 MB eslintbot

🚮 Removed packages: npm/@11ty/[email protected], npm/@11ty/[email protected], npm/@aws-sdk/[email protected], npm/@aws-sdk/[email protected], npm/@commitlint/[email protected], npm/@commitlint/[email protected], npm/@google-cloud/[email protected], npm/@google-cloud/[email protected], npm/@jackdbd/[email protected], npm/@jackdbd/[email protected], npm/@jackdbd/[email protected], npm/@microsoft/[email protected], npm/@microsoft/[email protected], npm/@thi.ng/[email protected], npm/@typescript-eslint/[email protected], npm/[email protected]

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/[email protected]...@jackdbd/[email protected]) (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/[email protected]...@jackdbd/[email protected]) (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/[email protected]...@jackdbd/[email protected]) (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/[email protected]...@jackdbd/[email protected]) (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/[email protected]...@jackdbd/[email protected]) (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/[email protected]...@jackdbd/[email protected]) (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/[email protected]...@jackdbd/[email protected]) (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/[email protected]

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/[email protected]

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/[email protected]

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/[email protected]

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/[email protected]

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/[email protected]

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/[email protected]

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