Skip to content

Commit 207bbe1

Browse files
authored
Merge pull request #84 from aminya/ci
test: add integration tests for the plugins + fix: update dependencies
2 parents a025871 + 999ec92 commit 207bbe1

File tree

23 files changed

+2874
-1948
lines changed

23 files changed

+2874
-1948
lines changed

.github/workflows/CI.yml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ on:
33
pull_request:
44
push:
55
branches:
6-
- master
76
- main
87

98
jobs:
@@ -15,22 +14,12 @@ jobs:
1514
matrix:
1615
os:
1716
- ubuntu-latest
18-
# - macos-latest
19-
# - windows-latest
20-
node:
21-
- 20
22-
pnpm:
23-
- 8
2417
steps:
2518
- uses: actions/checkout@v4
26-
2719
- uses: pnpm/action-setup@v4
28-
with:
29-
version: ${{ matrix.pnpm }}
30-
3120
- uses: actions/setup-node@v4
3221
with:
33-
node-version: ${{ matrix.node }}
22+
node-version-file: ".nvmrc"
3423
cache: "pnpm"
3524

3625
- name: Install and build

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22.14.0

cspell.config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ words:
1212
- applellvm
1313
- Astrojs
1414
- buildtools
15+
- Cascadia
1516
- caxa
1617
- ccache
1718
- choco
1819
- cmake
20+
- Consolas
1921
- CPATH
2022
- Cppcheck
2123
- CPPFLAGS
@@ -44,16 +46,19 @@ words:
4446
- msys
4547
- multilib
4648
- mxschmitt
49+
- Neue
4750
- noconfirm
4851
- noprogressbar
4952
- nothrow
5053
- npmrc
54+
- nvmrc
5155
- Opencppcoverage
5256
- OSSDK
5357
- parceljs
5458
- pnpm
5559
- pwsh
5660
- pypy
61+
- Roboto
5762
- setupcpp
5863
- setx
5964
- Syuu

package.json

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,35 @@
1111
"scripts": {
1212
"build": "pnpm -r run build",
1313
"bump": "pnpm exec ncu -u && pnpm -r exec ncu -u && typesync --ignoredeps=dev && pnpm update",
14-
"clean": "shx rm -rf ./packages/*/dist/",
14+
"clean": "shx rm -rf ./packages/*/dist/ ./test/dist/ ./test/.astro",
1515
"doc": "shx rm -rf packages/*/README.md && pnpm -r exec readme --path ../../dev/readme/template.md -y && pnpm -r exec ts-readme",
1616
"format": "prettier --write .",
1717
"lint": "eslint . --fix",
1818
"prepare": "pnpm run build",
1919
"publish": "pnpm -r publish",
20-
"test": "run-p test.cspell test.lint",
20+
"test": "run-p test.cspell test.lint && run-s test.posthtml test.htmlnano",
2121
"test.cspell": "cspell lint --no-progress --show-suggestions",
2222
"test.format": "prettier . --check",
23-
"test.lint": "eslint ."
23+
"test.htmlnano": "run-s clean build && cd test && cross-env NODE_ENV=production TEST=htmlnano pnpm build",
24+
"test.lint": "eslint .",
25+
"test.posthtml": "run-s clean build && cd test && cross-env NODE_ENV=production TEST=posthtml pnpm build"
2426
},
2527
"prettier": "prettier-config-atomic",
2628
"devDependencies": {
27-
"@types/node": "^20.11.30",
28-
"cspell": "^8.6.0",
29-
"eslint": "^8.57.0",
30-
"eslint-config-atomic": "^1.21.2",
31-
"npm-check-updates": "^16.14.17",
32-
"npm-run-all2": "^6.1.2",
33-
"prettier": "3.2.5",
34-
"prettier-config-atomic": "^4.0.0",
35-
"readme-md-generator": "^1.0.0",
36-
"shx": "^0.3.4",
37-
"ts-readme": "^1.1.3",
38-
"typescript": "^5.4.3",
39-
"typesync": "^0.12.1"
29+
"@types/node": "22.13.14",
30+
"cross-env": "^7.0.3",
31+
"cspell": "8.18.0",
32+
"eslint": "^8",
33+
"eslint-config-atomic": "1.22.1",
34+
"npm-check-updates": "17.1.16",
35+
"npm-run-all2": "7.0.2",
36+
"prettier": "3.5.3",
37+
"prettier-config-atomic": "4.0.0",
38+
"readme-md-generator": "1.0.0",
39+
"shx": "0.4.0",
40+
"ts-readme": "1.1.3",
41+
"typescript": "5.8.2",
42+
"typesync": "0.14.1"
4043
},
4144
"engines": {
4245
"node": ">=16"
@@ -60,7 +63,7 @@
6063
"relative-attribute",
6164
"attribute"
6265
],
63-
"packageManager": "pnpm@9.12.1",
66+
"packageManager": "pnpm@10.7.0",
6467
"packages": [
6568
"./packages/*"
6669
]

packages/astro-htmlnano/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@
1414
"prepublishOnly": "pnpm run build"
1515
},
1616
"dependencies": {
17-
"astro-posthtml": "workspace:*",
18-
"cssnano": "^7.0.0",
19-
"htmlnano": "2.1.1",
20-
"postcss": "^8.4.38",
17+
"astro-posthtml": "^1.1.3",
18+
"cssnano": "^7.0.6",
19+
"htmlnano": "^2.1.1",
20+
"postcss": "^8.5.3",
2121
"relateurl": "^0.2.7",
2222
"srcset": "^5.0.1",
23-
"svgo": "^3.2.0",
24-
"terser": "^5.29.2"
23+
"svgo": "^3.3.2",
24+
"terser": "^5.39.0"
2525
},
2626
"devDependencies": {
2727
"@types/relateurl": "^0.2.33"
2828
},
2929
"peerDependencies": {
30-
"astro": "^4 || ^5.0.0"
30+
"astro": "^4 || ^5"
3131
},
3232
"engines": {
3333
"node": ">=16.x"

packages/astro-htmlnano/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export function getAstroHTMLNano(options?: HtmlnanoOptions, preset?: Presets[key
2424
const htmlnanoOptions: HtmlnanoOptions = options ?? {}
2525

2626
// disable `removeComments` due to Astro's use of comments for hydration
27+
// eslint-disable-next-line @typescript-eslint/strict-boolean-expressions
2728
if (htmlnanoOptions.removeComments) {
2829
console.warn("`removeComments` is disabled due to Astro's use of comments for hydration.")
2930
}

packages/astro-posthtml/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import posthtml, { type Options, type Plugin } from "posthtml"
1919
*/
2020
export function getAstroPostHTML<PostHTMLUseThis, PostHTMLMessage>(
2121
plugins?: Plugin<PostHTMLUseThis>[],
22-
options?: Options
22+
options?: Options,
2323
) {
2424
return async (_context: APIContext, next: MiddlewareNext) => {
2525
const response = await next()
@@ -33,7 +33,7 @@ export function getAstroPostHTML<PostHTMLUseThis, PostHTMLMessage>(
3333
// modify HTML using posthtml
3434
const { html: modifiedHTML, messages } = await posthtml<PostHTMLUseThis, PostHTMLMessage>(plugins).process(
3535
originalHTML,
36-
options
36+
options,
3737
)
3838

3939
// log posthtml messages

0 commit comments

Comments
 (0)