Skip to content

Commit

Permalink
Merge pull request #11 from aminya/renovate/astro-4.x
Browse files Browse the repository at this point in the history
chore(deps): update dependency astro to v4
  • Loading branch information
aminya authored Jan 21, 2024
2 parents 64ec97a + 4176726 commit 5526947
Show file tree
Hide file tree
Showing 9 changed files with 702 additions and 1,255 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Minify Astro files with HTMLNano and CSSNano
- options (`HtmlnanoOptions`) - The HTMLNano options to use when transforming the HTML files
- preset (`HtmlnanoPreset`) - The HTMLNano preset to use

**returns:** (\_context: APIContext<Record<string, any>, Record<string, string>>, next: MiddlewareNext<Response>) => Promise<Response>
**returns:** (\_context: APIContext<Record<string, any>, Record<string, string>>, next: MiddlewareNext) => Promise<Response>

Create `./src/middleware.ts` with the following content:

Expand Down Expand Up @@ -68,7 +68,7 @@ Transform Astro files with PostHTML
- plugins (`Plugin<PostHTMLUseThis>[]`) - The posthtml plugins to use when transforming the HTML files
- options (`Options`) - The posthtml options

**returns:** (\_context: APIContext<Record<string, any>, Record<string, string>>, next: MiddlewareNext<Response>) => Promise<Response>
**returns:** (\_context: APIContext<Record<string, any>, Record<string, string>>, next: MiddlewareNext) => Promise<Response>

Create `./src/middleware.ts` with the following content:

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"eslint-config-atomic": "^1.20.6",
"npm-check-updates": "^16.14.12",
"npm-run-all2": "^6.1.1",
"prettier": "3.2.4",
"prettier": "3.2.2",
"prettier-config-atomic": "^4.0.0",
"readme-md-generator": "^1.0.0",
"shx": "^0.3.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/astro-htmlnano/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Minify Astro files with HTMLNano and CSSNano in the production mode
- options (`HtmlnanoOptions`) - The HTMLNano options to use when transforming the HTML files
- preset (`HtmlnanoPreset`) - The HTMLNano preset to use

**returns:** (\_context: APIContext<Record<string, any>, Record<string, string>>, next: MiddlewareNext<Response>) => Promise<Response>
**returns:** (\_context: APIContext<Record<string, any>, Record<string, string>>, next: MiddlewareNext) => Promise<Response>

Create `./src/middleware.ts` with the following content:

Expand Down
2 changes: 1 addition & 1 deletion packages/astro-htmlnano/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"@types/relateurl": "^0.2.33"
},
"peerDependencies": {
"astro": "3.2.0"
"astro": "4.2.1"
},
"engines": {
"node": ">=16.x"
Expand Down
5 changes: 2 additions & 3 deletions packages/astro-htmlnano/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ import htmlnano, { type HtmlnanoOptions, type Presets } from "htmlnano/index.mjs
*/
export function getAstroHTMLNano(options?: HtmlnanoOptions, preset?: Presets[keyof Presets]) {
if (process.env.NODE_ENV === "production") {
return (_context: APIContext, next: MiddlewareNext<Response>) =>
getAstroPostHTML([htmlnano(options, preset)])(_context, next)
return (_context: APIContext, next: MiddlewareNext) => getAstroPostHTML([htmlnano(options, preset)])(_context, next)
}
return (_context: APIContext, next: MiddlewareNext<Response>) => next()
return (_context: APIContext, next: MiddlewareNext) => next()
}
2 changes: 1 addition & 1 deletion packages/astro-posthtml/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Transform Astro files with PostHTML
- plugins (`Plugin<PostHTMLUseThis>[]`) - The posthtml plugins to use when transforming the HTML files
- options (`Options`) - The posthtml options

**returns:** (\_context: APIContext<Record<string, any>, Record<string, string>>, next: MiddlewareNext<Response>) => Promise<Response>
**returns:** (\_context: APIContext<Record<string, any>, Record<string, string>>, next: MiddlewareNext) => Promise<Response>

Create `./src/middleware.ts` with the following content:

Expand Down
2 changes: 1 addition & 1 deletion packages/astro-posthtml/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"devDependencies": {},
"peerDependencies": {
"astro": "3.2.0"
"astro": "4.2.1"
},
"engines": {
"node": ">=16.x"
Expand Down
2 changes: 1 addition & 1 deletion packages/astro-posthtml/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function getAstroPostHTML<PostHTMLUseThis, PostHTMLMessage>(
plugins?: Plugin<PostHTMLUseThis>[],
options?: Options
) {
return async (_context: APIContext, next: MiddlewareNext<Response>) => {
return async (_context: APIContext, next: MiddlewareNext) => {
const response = await next()
const originalHTML = await response.text()

Expand Down
Loading

0 comments on commit 5526947

Please sign in to comment.