Skip to content

Commit 4b9f3ab

Browse files
committed
chore: update dependencies
Bump all dependencies to their latest versions (htmljs-parser 5.12.1, prettier 3.9, @marko/compiler 5.40, lint-staged 17, @types/node 26, rolldown 1.1, typescript-eslint 8.62, etc.) and clear the resulting audit advisories, adapting to breaking changes along the way: - htmljs-parser 5.12 exposes `TagType` as a const object + type alias rather than an enum, so use `typeof TagType.*` where a type is needed. - @marko/compiler 5.40 types `traverseFast.skip` as a `unique symbol`; recover the precise type from the visitor signature. - Refresh the generic-tag snapshots for prettier 3.9's parenthesization of nested conditional types in `extends` constraints. - Require htmljs-parser ^5.12.1, which fixes attribute values with a trailing line comment being treated as self-enclosed and leaking past the tag.
1 parent f34de53 commit 4b9f3ab

9 files changed

Lines changed: 487 additions & 455 deletions

File tree

.changeset/cool-days-attack.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"prettier-plugin-marko": patch
3+
---
4+
5+
Require htmljs-parser ^5.12.1, which fixes attribute-value trailing line comments being treated as self-enclosed and leaking past the tag.

package-lock.json

Lines changed: 448 additions & 426 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,26 +43,26 @@
4343
"test:update": "vitest run --update"
4444
},
4545
"dependencies": {
46-
"htmljs-parser": "^5.10.2"
46+
"htmljs-parser": "^5.12.1"
4747
},
4848
"devDependencies": {
49-
"@changesets/changelog-github": "^0.6.0",
50-
"@changesets/cli": "^2.30.0",
49+
"@changesets/changelog-github": "^0.7.0",
50+
"@changesets/cli": "^2.31.0",
5151
"@eslint/js": "^10.0.1",
52-
"@marko/compiler": "^5.39.62",
53-
"@types/node": "^25.6.0",
54-
"@vitest/coverage-v8": "^4.1.4",
55-
"eslint": "^10.2.0",
52+
"@marko/compiler": "^5.40.0",
53+
"@types/node": "^26.1.0",
54+
"@vitest/coverage-v8": "^4.1.9",
55+
"eslint": "^10.6.0",
5656
"eslint-plugin-simple-import-sort": "^13.0.0",
57-
"globals": "^17.5.0",
57+
"globals": "^17.7.0",
5858
"husky": "^9.1.7",
59-
"lint-staged": "^16.4.0",
60-
"marko": "^6.0.160",
61-
"prettier": "^3.8.2",
59+
"lint-staged": "^17.0.8",
60+
"marko": "^6.2.1",
61+
"prettier": "^3.9.4",
6262
"prettier-plugin-packagejson": "^3.0.2",
63-
"rolldown": "^1.0.0-rc.15",
64-
"typescript": "^6.0.2",
65-
"typescript-eslint": "^8.58.2",
66-
"vitest": "^4.1.4"
63+
"rolldown": "^1.1.4",
64+
"typescript": "^6.0.3",
65+
"typescript-eslint": "^8.62.1",
66+
"vitest": "^4.1.9"
6767
}
6868
}

src/__tests__/fixtures/generic-tag/__snapshots__/auto.expected.marko

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@
3939
<my-tag <
4040
T extends
4141
keyof (typeof SuperLongImportedVariableName)["member1"]["member2"]["member3"],
42-
K extends T extends string
42+
K extends (T extends string
4343
? MyType["member1"]["member2"]["member3"]
44-
: MyOtherType,
44+
: MyOtherType),
4545
>|x|/>
4646
<my-tag<{
4747
foo: number;

src/__tests__/fixtures/generic-tag/__snapshots__/concise.expected.marko

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ my-tag<
3939
my-tag <
4040
T extends
4141
keyof (typeof SuperLongImportedVariableName)["member1"]["member2"]["member3"],
42-
K extends T extends string
42+
K extends (T extends string
4343
? MyType["member1"]["member2"]["member3"]
44-
: MyOtherType,
44+
: MyOtherType),
4545
>|x|
4646
my-tag<{
4747
foo: number;

src/__tests__/fixtures/generic-tag/__snapshots__/html.expected.marko

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@
3939
<my-tag <
4040
T extends
4141
keyof (typeof SuperLongImportedVariableName)["member1"]["member2"]["member3"],
42-
K extends T extends string
42+
K extends (T extends string
4343
? MyType["member1"]["member2"]["member3"]
44-
: MyOtherType,
44+
: MyOtherType),
4545
>|x|/>
4646
<my-tag<{
4747
foo: number;

src/__tests__/index.test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ import * as plugin from "..";
88

99
const fixtures = path.join(import.meta.dirname, "fixtures");
1010
const { traverseFast } = compiler.types;
11-
const skip = (traverseFast as any).skip as symbol;
11+
// `traverseFast.skip` is a `unique symbol`, but the `@marko/compiler` re-export
12+
// widens it to `symbol`; recover the precise type from the visitor signature.
13+
const skip = traverseFast.skip as Exclude<
14+
ReturnType<Parameters<typeof traverseFast>[1]>,
15+
void
16+
>;
1217
const compileOpts: compiler.Config = {
1318
output: "source",
1419
ast: true,

src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ const embedHandlers: EmbedHandlers = {
447447
Array.isArray(varPart.contents)
448448
) {
449449
const varContents = varPart.contents;
450-
for (let i = varContents.length; i--; ) {
450+
for (let i = varContents.length; i--;) {
451451
const item = varContents[i];
452452
if (typeof item === "string") {
453453
// Walks back until we find the equals sign.
@@ -969,7 +969,7 @@ function trimText(text: string, path: AstPath<Node.Text>) {
969969
let prev: Node.ChildNode | undefined;
970970
let next: Node.ChildNode | undefined;
971971

972-
for (let i = path.index!; --i >= 0; ) {
972+
for (let i = path.index!; --i >= 0;) {
973973
const sibling = siblings[i];
974974
if (
975975
sibling.type !== NodeType.Scriptlet &&
@@ -980,7 +980,7 @@ function trimText(text: string, path: AstPath<Node.Text>) {
980980
}
981981
}
982982

983-
for (let i = path.index!; ++i < siblings.length; ) {
983+
for (let i = path.index!; ++i < siblings.length;) {
984984
const sibling = siblings[i];
985985
if (
986986
sibling.type !== NodeType.Scriptlet &&

src/parser.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export namespace Node {
9393
export type AttrNode = AttrNamed | AttrSpread;
9494
export type ControlFlowTag = Tag & {
9595
nameText: "if" | "else" | "else-if" | "for" | "while";
96-
bodyType: TagType.html;
96+
bodyType: typeof TagType.html;
9797
};
9898
export type ChildNode =
9999
| Tag
@@ -122,7 +122,7 @@ export namespace Node {
122122
open: Range;
123123
close: Range | undefined;
124124
nameText: string | undefined;
125-
bodyType: Exclude<TagType, "statement">;
125+
bodyType: Exclude<TagType, typeof TagType.statement>;
126126
name: OpenTagName;
127127
var: TagVar | undefined;
128128
args: TagArgs | undefined;
@@ -145,7 +145,7 @@ export namespace Node {
145145
open: Range;
146146
close: Range | undefined;
147147
nameText: string;
148-
bodyType: TagType.html;
148+
bodyType: typeof TagType.html;
149149
name: OpenTagName;
150150
var: TagVar | undefined;
151151
args: TagArgs | undefined;
@@ -419,7 +419,7 @@ class Builder {
419419
let concise = true;
420420
let start = range.start;
421421
let type = NodeType.Tag;
422-
let bodyType = TagType.html;
422+
let bodyType: TagType = TagType.html;
423423
let nameText: string | undefined = undefined;
424424

425425
if (this.#openTagStart) {

0 commit comments

Comments
 (0)