Skip to content

Commit 5f99235

Browse files
authored
chore: use deno fmt (#20)
* chore: use deno fmt * prosewrap never
1 parent 2073dd8 commit 5f99235

File tree

20 files changed

+487
-482
lines changed

20 files changed

+487
-482
lines changed

.changeset/README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# Changesets
22

3-
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4-
with multi-package repos, or single-package repos to help you version and publish your code. You can
5-
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works with multi-package repos, or single-package repos to help you version and publish your code. You can find the full documentation for it [in our repository](https://github.com/changesets/changesets)
64

7-
We have a quick list of common questions to get you started engaging with this project in
8-
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
5+
We have a quick list of common questions to get you started engaging with this project in [our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
"baseBranch": "main",
99
"updateInternalDependencies": "patch",
1010
"ignore": []
11-
}
11+
}

.prettierignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

.prettierrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

.vscode/settings.json

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
11
{
2-
"typescript.tsdk": "node_modules/typescript/lib"
3-
}
2+
"typescript.tsdk": "node_modules/typescript/lib",
3+
"deno.enable": true,
4+
"deno.config": "./deno.json",
5+
"deno.suggest.imports.hosts": {
6+
"https://deno.land": true,
7+
"https://jsr.io": true
8+
},
9+
"[typescript]": {
10+
"editor.defaultFormatter": "denoland.vscode-deno"
11+
},
12+
"[javascript]": {
13+
"editor.defaultFormatter": "denoland.vscode-deno"
14+
},
15+
"prettier.enable": false,
16+
"deno.enablePaths": [
17+
"packages"
18+
]
19+
}

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@ This repository is a monorepo containing several packages related to CDN cache c
66

77
- `cdn-cache-control`: Easy, opinionated CDN cache header handling.
88
- `cache-handlers`: Modern CDN cache primitives using web-standard middleware.
9-

deno.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
11
{
2-
"workspace": ["packages/cdn-cache-control"]
2+
"workspace": ["packages/cdn-cache-control"],
3+
"imports": {
4+
"@std/assert": "jsr:@std/assert@^1.0.13"
5+
},
6+
"fmt": {
7+
"useTabs": true,
8+
"useBraces": "always",
9+
"singleBodyPosition": "nextLine",
10+
"proseWrap": "never",
11+
"exclude": [
12+
"**/*/package.json",
13+
"pnpm-lock.yaml",
14+
"**/*/CHANGELOG.md",
15+
"package.json"
16+
]
17+
}
318
}

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@
77
"lint": "pnpm -r lint",
88
"check": "pnpm -r check",
99
"version": "changeset version && pnpm -r version",
10-
"format": "pnpm -r format --write"
10+
"format": "deno fmt"
1111
},
1212
"devDependencies": {
1313
"@changesets/cli": "^2.27.7",
14-
"prettier": "^3.3.1",
1514
"tsdoc-markdown": "^0.6.0",
1615
"typescript": "^5.9.2"
1716
},
1817
"packageManager": "[email protected]+sha1.bb42032ff80dba5f9245bc1b03470d2fa0b7fb2f"
19-
}
18+
}

packages/cdn-cache-control/README.md

Lines changed: 29 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ export default async function handler(req: Request) => {
9595
});
9696
return new Response("Purged!", { status: 202 })
9797
};
98-
9998
```
10099

101100
#### Using the generated headers
@@ -106,9 +105,9 @@ The headers object can be used anywhere that accepts a `fetch` `Headers` object.
106105
import { CacheHeaders } from "cdn-cache-control";
107106

108107
export default async function handler(request: Request): Promise<Response> {
109-
const headers = new CacheHeaders().swr();
110-
// The `Response` constructor accepts the object directly
111-
return new Response("Hello", { headers });
108+
const headers = new CacheHeaders().swr();
109+
// The `Response` constructor accepts the object directly
110+
return new Response("Hello", { headers });
112111
}
113112
```
114113

@@ -120,7 +119,6 @@ import { CacheHeaders, ONE_HOUR } from "cdn-cache-control";
120119
121120
new CacheHeaders().swr(ONE_HOUR).copyTo(Astro.response.headers);
122121
---
123-
124122
```
125123

126124
## API
@@ -181,32 +179,32 @@ Number of seconds in one year
181179

182180
- [Installation](#installation)
183181
- [Usage](#usage)
184-
- [Use cases](#use-cases)
185-
- [stale-while-revalidate](#stale-while-revalidate)
186-
- [Immutable content](#immutable-content)
187-
- [Cache tags](#cache-tags)
188-
- [Using the generated headers](#using-the-generated-headers)
182+
- [Use cases](#use-cases)
183+
- [stale-while-revalidate](#stale-while-revalidate)
184+
- [Immutable content](#immutable-content)
185+
- [Cache tags](#cache-tags)
186+
- [Using the generated headers](#using-the-generated-headers)
189187
- [API](#api)
190188
- [:wrench: Constants](#wrench-constants)
191-
- [:gear: ONE\_MINUTE](#gear-one_minute)
192-
- [:gear: ONE\_HOUR](#gear-one_hour)
193-
- [:gear: ONE\_DAY](#gear-one_day)
194-
- [:gear: ONE\_WEEK](#gear-one_week)
195-
- [:gear: ONE\_YEAR](#gear-one_year)
189+
- [:gear: ONE\_MINUTE](#gear-one_minute)
190+
- [:gear: ONE\_HOUR](#gear-one_hour)
191+
- [:gear: ONE\_DAY](#gear-one_day)
192+
- [:gear: ONE\_WEEK](#gear-one_week)
193+
- [:gear: ONE\_YEAR](#gear-one_year)
196194
- [:factory: CacheHeaders](#factory-cacheheaders)
197-
- [Methods](#methods)
198-
- [:gear: tag](#gear-tag)
199-
- [:gear: swr](#gear-swr)
200-
- [:gear: immutable](#gear-immutable)
201-
- [:gear: ttl](#gear-ttl)
202-
- [:gear: toObject](#gear-toobject)
203-
- [:gear: copyTo](#gear-copyto)
204-
- [:gear: getCdnCacheControl](#gear-getcdncachecontrol)
205-
- [:gear: setCdnCacheControl](#gear-setcdncachecontrol)
206-
- [:gear: getCacheControl](#gear-getcachecontrol)
207-
- [:gear: setCacheControl](#gear-setcachecontrol)
208-
- [:gear: getCacheTags](#gear-getcachetags)
209-
- [:gear: setCacheTags](#gear-setcachetags)
195+
- [Methods](#methods)
196+
- [:gear: tag](#gear-tag)
197+
- [:gear: swr](#gear-swr)
198+
- [:gear: immutable](#gear-immutable)
199+
- [:gear: ttl](#gear-ttl)
200+
- [:gear: toObject](#gear-toobject)
201+
- [:gear: copyTo](#gear-copyto)
202+
- [:gear: getCdnCacheControl](#gear-getcdncachecontrol)
203+
- [:gear: setCdnCacheControl](#gear-setcdncachecontrol)
204+
- [:gear: getCacheControl](#gear-getcachecontrol)
205+
- [:gear: setCacheControl](#gear-setcachecontrol)
206+
- [:gear: getCacheTags](#gear-getcachetags)
207+
- [:gear: setCacheTags](#gear-setcachetags)
210208

211209
#### :gear: tag
212210

@@ -222,8 +220,7 @@ Parameters:
222220

223221
#### :gear: swr
224222

225-
Sets stale-while-revalidate directive for the CDN cache. By default the browser is sent a must-revalidate
226-
directive to ensure that the browser always revalidates the cache with the server.
223+
Sets stale-while-revalidate directive for the CDN cache. By default the browser is sent a must-revalidate directive to ensure that the browser always revalidates the cache with the server.
227224

228225
| Method | Type |
229226
| ------ | -------------------------- |
@@ -235,10 +232,7 @@ Parameters:
235232

236233
#### :gear: immutable
237234

238-
Sets cache headers for content that should be cached for a long time and never revalidated.
239-
The CDN cache will cache the content for the specified time, and the browser will cache the content
240-
indefinitely without revalidating. Do not use this unless the URL is fingerprinted or otherwise unique.
241-
Otherwise, the browser will cache the content indefinitely and never check for updates, including for new deploys.
235+
Sets cache headers for content that should be cached for a long time and never revalidated. The CDN cache will cache the content for the specified time, and the browser will cache the content indefinitely without revalidating. Do not use this unless the URL is fingerprinted or otherwise unique. Otherwise, the browser will cache the content indefinitely and never check for updates, including for new deploys.
242236

243237
| Method | Type |
244238
| ----------- | -------------------------- |
@@ -250,9 +244,7 @@ Parameters:
250244

251245
#### :gear: ttl
252246

253-
Sets the s-maxage for items in the CDN cache. This is the maximum amount of time that the CDN will cache the content.
254-
If used with swr, the content will revalidate in the background after the max age has passed. Otherwise, the content will be
255-
removed from the cache after the max age has passed.
247+
Sets the s-maxage for items in the CDN cache. This is the maximum amount of time that the CDN will cache the content. If used with swr, the content will revalidate in the background after the max age has passed. Otherwise, the content will be removed from the cache after the max age has passed.
256248

257249
| Method | Type |
258250
| ------ | ------------------------- |
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"name": "@ascorbic/cdn-cache-control",
3-
"version": "1.3.1",
4-
"exports": "./src/index.ts",
5-
"license": "MIT",
6-
"publish": {
7-
"include": ["README.md", "src/index.ts"]
8-
}
2+
"name": "@ascorbic/cdn-cache-control",
3+
"version": "1.3.1",
4+
"exports": "./src/index.ts",
5+
"license": "MIT",
6+
"publish": {
7+
"include": ["README.md", "src/index.ts"]
8+
}
99
}

0 commit comments

Comments
 (0)