chore: update deps, improve static statement source locations

This commit is contained in:
dpiercey 2025-08-13 09:12:05 -07:00 committed by Dylan Piercey
parent b6e9cb7ed6
commit 9ba0cab647
50 changed files with 615 additions and 633 deletions

View File

@ -0,0 +1,8 @@
---
"@marko/translator-interop-class-tags": patch
"marko": patch
"@marko/runtime-tags": patch
"@marko/compiler": patch
---
Update package dependencies.

View File

@ -0,0 +1,6 @@
---
"marko": patch
"@marko/runtime-tags": patch
---
Improve source location information for static statements.

View File

@ -63,12 +63,12 @@
"brotli": 123
},
"runtime": {
"min": 2355,
"brotli": 1202
"min": 2340,
"brotli": 1186
},
"total": {
"min": 2497,
"brotli": 1325
"min": 2482,
"brotli": 1309
}
}
]

949
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -33,24 +33,24 @@
"@changesets/changelog-github": "^0.5.1",
"@changesets/cli": "^2.29.5",
"@ebay/browserslist-config": "^2.11.0",
"@eslint/js": "^9.31.0",
"@eslint/js": "^9.33.0",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-virtual": "^3.0.2",
"@types/babel__code-frame": "^7.0.6",
"@types/babel__generator": "^7.27.0",
"@types/babel__traverse": "^7.20.7",
"@types/babel__traverse": "^7.28.0",
"@types/jsdom": "^21.1.7",
"@types/mocha": "^10.0.10",
"@types/node": "^24.0.13",
"@types/node": "^24.2.1",
"~ts": "file:scripts/babel-register.js",
"babel-plugin-minprops": "^2.0.1",
"bluebird": "^3.7.2",
"c8": "^10.1.3",
"chai": "^4.4.1",
"cross-env": "^7.0.3",
"diffable-html": "^5.0.0",
"esbuild": "^0.25.6",
"eslint": "^9.31.0",
"cross-env": "^10.0.0",
"diffable-html": "^6.0.1",
"esbuild": "^0.25.9",
"eslint": "^9.33.0",
"eslint-formatter-unix": "^8.40.0",
"eslint-plugin-simple-import-sort": "^12.1.1",
"express": "^5.1.0",
@ -60,19 +60,19 @@
"jsdom": "^26.1.0",
"jsdom-context-require": "^5.2.5",
"kleur": "^4.1.5",
"lint-staged": "^16.1.2",
"lint-staged": "^16.1.5",
"mocha": "^11.7.1",
"mocha-autotest": "^1.1.3",
"mocha-snap": "^5.0.0",
"prettier": "^3.6.2",
"prettier-plugin-packagejson": "^2.5.18",
"pretty-format": "^30.0.2",
"rollup": "^4.44.2",
"prettier-plugin-packagejson": "^2.5.19",
"pretty-format": "^30.0.5",
"rollup": "^4.46.2",
"table": "^6.9.0",
"through": "^2.3.8",
"through2": "^4.0.2",
"tiny-glob": "^0.2.9",
"typescript": "^5.8.3",
"typescript-eslint": "^8.36.0"
"typescript": "^5.9.2",
"typescript-eslint": "^8.39.1"
}
}

View File

@ -69,13 +69,13 @@
"@babel/plugin-syntax-typescript": "^7.27.1",
"@babel/plugin-transform-modules-commonjs": "^7.27.1",
"@babel/plugin-transform-typescript": "^7.28.0",
"@babel/runtime": "^7.27.6",
"@babel/runtime": "^7.28.2",
"@babel/traverse": "^7.28.0",
"@babel/types": "^7.28.0",
"@babel/types": "^7.28.2",
"@luxass/strip-json-comments": "^1.4.0",
"complain": "^1.6.1",
"he": "^1.2.0",
"htmljs-parser": "^5.5.4",
"htmljs-parser": "^5.7.3",
"jsesc": "^3.1.0",
"kleur": "^4.1.5",
"lasso-package-root": "^1.0.1",
@ -87,7 +87,7 @@
"source-map-support": "^0.5.21"
},
"devDependencies": {
"marko": "^5.37.41"
"marko": "^5.37.42"
},
"engines": {
"node": "18 || 20 || >=22"

View File

@ -69,8 +69,8 @@
"build": "babel ./src --out-dir ./dist --extensions .js --copy-files --config-file ../../babel.config.js --env-name=production"
},
"dependencies": {
"@babel/runtime": "^7.27.6",
"@marko/compiler": "^5.39.29",
"@babel/runtime": "^7.28.2",
"@marko/compiler": "^5.39.31",
"app-module-path": "^2.2.0",
"argly": "^1.2.0",
"browser-refresh-client": "1.1.4",

View File

@ -12,11 +12,7 @@ export default function (path) {
node,
hub: { file },
} = path;
const {
rawValue: code,
name: { start },
end,
} = node;
const { rawValue: code, start, end } = node;
const meta = file.metadata.marko;
if (meta.hasComponent) {

View File

@ -5,10 +5,7 @@ export default function (path) {
node,
hub: { file },
} = path;
const {
rawValue,
name: { start, end },
} = node;
const { rawValue, start, end } = node;
const [exportNode] = parseStatements(file, rawValue, start, end);
path.replaceWith(exportNode);
}

View File

@ -5,10 +5,7 @@ export default function (path) {
node,
hub: { file },
} = path;
const {
rawValue,
name: { start, end },
} = node;
const { rawValue, start, end } = node;
const [importNode] = parseStatements(file, rawValue, start, end);
path.replaceWith(importNode);
}

View File

@ -7,8 +7,8 @@ export default function (path) {
hub: { file },
} = path;
const { rawValue, end } = node;
const code = rawValue.replace(/^static\s*/, "").trim();
const start = node.name.start + (rawValue.length - code.length);
const code = rawValue.replace(/^static\s*/, "");
const start = node.start + (rawValue.length - code.length);
let body = parseStatements(file, code, start, end);
if (body.length === 1 && t.isBlockStatement(body[0])) {
body = body[0].body;

View File

@ -1,4 +1,4 @@
CompileErrors:
CompileError:
at __tests__/template.marko:7:9
5 | }};
6 |
@ -6,13 +6,4 @@ CompileErrors:
| ^ Unexpected token
8 | world: true
9 | };
10 | }
at __tests__/template.marko:11:3
9 | };
10 | }
> 11 | onFoo() {
| ^ Line has extra indentation at the beginning
12 | console.log("bar")
13 | }
14 | }
10 | }

View File

@ -1,4 +1,4 @@
CompileErrors:
CompileError:
at __tests__/template.marko:7:9
5 | }};
6 |
@ -6,13 +6,4 @@ CompileErrors:
| ^ Unexpected token
8 | world: true
9 | };
10 | }
at __tests__/template.marko:11:3
9 | };
10 | }
> 11 | onFoo() {
| ^ Line has extra indentation at the beginning
12 | console.log("bar")
13 | }
14 | }
10 | }

View File

@ -1,4 +1,4 @@
CompileErrors:
CompileError:
at __tests__/template.marko:7:9
5 | }};
6 |
@ -6,13 +6,4 @@ CompileErrors:
| ^ Unexpected token
8 | world: true
9 | };
10 | }
at __tests__/template.marko:11:3
9 | };
10 | }
> 11 | onFoo() {
| ^ Line has extra indentation at the beginning
12 | console.log("bar")
13 | }
14 | }
10 | }

View File

@ -1,4 +1,4 @@
CompileErrors:
CompileError:
at __tests__/template.marko:7:9
5 | }};
6 |
@ -6,13 +6,4 @@ CompileErrors:
| ^ Unexpected token
8 | world: true
9 | };
10 | }
at __tests__/template.marko:11:3
9 | };
10 | }
> 11 | onFoo() {
| ^ Line has extra indentation at the beginning
12 | console.log("bar")
13 | }
14 | }
10 | }

View File

@ -1,4 +1,4 @@
CompileErrors:
CompileError:
at __tests__/template.marko:7:9
5 | }};
6 |
@ -6,13 +6,4 @@ CompileErrors:
| ^ Unexpected token
8 | world: true
9 | };
10 | }
at __tests__/template.marko:11:3
9 | };
10 | }
> 11 | onFoo() {
| ^ Line has extra indentation at the beginning
12 | console.log("bar")
13 | }
14 | }
10 | }

View File

@ -1,4 +1,4 @@
CompileErrors:
CompileError:
at __tests__/template.marko:7:9
5 | }};
6 |
@ -6,13 +6,4 @@ CompileErrors:
| ^ Unexpected token
8 | world: true
9 | };
10 | }
at __tests__/template.marko:11:3
9 | };
10 | }
> 11 | onFoo() {
| ^ Line has extra indentation at the beginning
12 | console.log("bar")
13 | }
14 | }
10 | }

View File

@ -1,4 +1,4 @@
CompileErrors:
CompileError:
at __tests__/template.marko:7:9
5 | }};
6 |
@ -6,13 +6,4 @@ CompileErrors:
| ^ Unexpected token
8 | world: true
9 | };
10 | }
at __tests__/template.marko:11:3
9 | };
10 | }
> 11 | onFoo() {
| ^ Line has extra indentation at the beginning
12 | console.log("bar")
13 | }
14 | }
10 | }

View File

@ -1,6 +1,6 @@
CompileError:
at __tests__/template.marko:2:2
at __tests__/template.marko:2:7
1 | class {}
> 2 | <div/>
| ^ Line has extra indentation at the beginning
| ^ Unexpected token
3 |

View File

@ -1,6 +1,6 @@
CompileError:
at __tests__/template.marko:2:2
at __tests__/template.marko:2:7
1 | class {}
> 2 | <div/>
| ^ Line has extra indentation at the beginning
| ^ Unexpected token
3 |

View File

@ -1,6 +1,6 @@
CompileError:
at __tests__/template.marko:2:2
at __tests__/template.marko:2:7
1 | class {}
> 2 | <div/>
| ^ Line has extra indentation at the beginning
| ^ Unexpected token
3 |

View File

@ -1,6 +1,6 @@
CompileError:
at __tests__/template.marko:2:2
at __tests__/template.marko:2:7
1 | class {}
> 2 | <div/>
| ^ Line has extra indentation at the beginning
| ^ Unexpected token
3 |

View File

@ -1,6 +1,6 @@
CompileError:
at __tests__/template.marko:2:2
at __tests__/template.marko:2:7
1 | class {}
> 2 | <div/>
| ^ Line has extra indentation at the beginning
| ^ Unexpected token
3 |

View File

@ -1,6 +1,6 @@
CompileError:
at __tests__/template.marko:2:2
at __tests__/template.marko:2:7
1 | class {}
> 2 | <div/>
| ^ Line has extra indentation at the beginning
| ^ Unexpected token
3 |

View File

@ -1,6 +1,6 @@
CompileError:
at __tests__/template.marko:2:2
at __tests__/template.marko:2:7
1 | class {}
> 2 | <div/>
| ^ Line has extra indentation at the beginning
| ^ Unexpected token
3 |

View File

@ -1,6 +1,6 @@
CompileError:
at __tests__/template.marko:2:2
at __tests__/template.marko:2:6
1 | export { a } from "b";
> 2 | <div/>
| ^ Line has extra indentation at the beginning
| ^ Unexpected token, expected ","
3 |

View File

@ -1,6 +1,6 @@
CompileError:
at __tests__/template.marko:2:2
at __tests__/template.marko:2:6
1 | export { a } from "b";
> 2 | <div/>
| ^ Line has extra indentation at the beginning
| ^ Unexpected token, expected ","
3 |

View File

@ -1,6 +1,6 @@
CompileError:
at __tests__/template.marko:2:2
at __tests__/template.marko:2:6
1 | export { a } from "b";
> 2 | <div/>
| ^ Line has extra indentation at the beginning
| ^ Unexpected token, expected ","
3 |

View File

@ -1,6 +1,6 @@
CompileError:
at __tests__/template.marko:2:2
at __tests__/template.marko:2:6
1 | export { a } from "b";
> 2 | <div/>
| ^ Line has extra indentation at the beginning
| ^ Unexpected token, expected ","
3 |

View File

@ -1,6 +1,6 @@
CompileError:
at __tests__/template.marko:2:2
at __tests__/template.marko:2:6
1 | export { a } from "b";
> 2 | <div/>
| ^ Line has extra indentation at the beginning
| ^ Unexpected token, expected ","
3 |

View File

@ -1,6 +1,6 @@
CompileError:
at __tests__/template.marko:2:2
at __tests__/template.marko:2:6
1 | export { a } from "b";
> 2 | <div/>
| ^ Line has extra indentation at the beginning
| ^ Unexpected token, expected ","
3 |

View File

@ -1,6 +1,6 @@
CompileError:
at __tests__/template.marko:2:2
at __tests__/template.marko:2:6
1 | export { a } from "b";
> 2 | <div/>
| ^ Line has extra indentation at the beginning
| ^ Unexpected token, expected ","
3 |

View File

@ -1,6 +1,6 @@
CompileError:
at __tests__/template.marko:2:2
at __tests__/template.marko:2:6
1 | import a from "b";
> 2 | <div/>
| ^ Line has extra indentation at the beginning
| ^ Unexpected token, expected ","
3 |

View File

@ -1,6 +1,6 @@
CompileError:
at __tests__/template.marko:2:2
at __tests__/template.marko:2:6
1 | import a from "b";
> 2 | <div/>
| ^ Line has extra indentation at the beginning
| ^ Unexpected token, expected ","
3 |

View File

@ -1,6 +1,6 @@
CompileError:
at __tests__/template.marko:2:2
at __tests__/template.marko:2:6
1 | import a from "b";
> 2 | <div/>
| ^ Line has extra indentation at the beginning
| ^ Unexpected token, expected ","
3 |

View File

@ -1,6 +1,6 @@
CompileError:
at __tests__/template.marko:2:2
at __tests__/template.marko:2:6
1 | import a from "b";
> 2 | <div/>
| ^ Line has extra indentation at the beginning
| ^ Unexpected token, expected ","
3 |

View File

@ -1,6 +1,6 @@
CompileError:
at __tests__/template.marko:2:2
at __tests__/template.marko:2:6
1 | import a from "b";
> 2 | <div/>
| ^ Line has extra indentation at the beginning
| ^ Unexpected token, expected ","
3 |

View File

@ -1,6 +1,6 @@
CompileError:
at __tests__/template.marko:2:2
at __tests__/template.marko:2:6
1 | import a from "b";
> 2 | <div/>
| ^ Line has extra indentation at the beginning
| ^ Unexpected token, expected ","
3 |

View File

@ -1,6 +1,6 @@
CompileError:
at __tests__/template.marko:2:2
at __tests__/template.marko:2:6
1 | import a from "b";
> 2 | <div/>
| ^ Line has extra indentation at the beginning
| ^ Unexpected token, expected ","
3 |

View File

@ -1,6 +1,6 @@
CompileError:
at __tests__/template.marko:2:2
at __tests__/template.marko:2:6
1 | static { console.log(x); }
> 2 | <div/>
| ^ Line has extra indentation at the beginning
| ^ Unexpected token, expected ","
3 |

View File

@ -1,6 +1,6 @@
CompileError:
at __tests__/template.marko:2:2
at __tests__/template.marko:2:6
1 | static { console.log(x); }
> 2 | <div/>
| ^ Line has extra indentation at the beginning
| ^ Unexpected token, expected ","
3 |

View File

@ -1,6 +1,6 @@
CompileError:
at __tests__/template.marko:2:2
at __tests__/template.marko:2:6
1 | static { console.log(x); }
> 2 | <div/>
| ^ Line has extra indentation at the beginning
| ^ Unexpected token, expected ","
3 |

View File

@ -1,6 +1,6 @@
CompileError:
at __tests__/template.marko:2:2
at __tests__/template.marko:2:6
1 | static { console.log(x); }
> 2 | <div/>
| ^ Line has extra indentation at the beginning
| ^ Unexpected token, expected ","
3 |

View File

@ -1,6 +1,6 @@
CompileError:
at __tests__/template.marko:2:2
at __tests__/template.marko:2:6
1 | static { console.log(x); }
> 2 | <div/>
| ^ Line has extra indentation at the beginning
| ^ Unexpected token, expected ","
3 |

View File

@ -1,6 +1,6 @@
CompileError:
at __tests__/template.marko:2:2
at __tests__/template.marko:2:6
1 | static { console.log(x); }
> 2 | <div/>
| ^ Line has extra indentation at the beginning
| ^ Unexpected token, expected ","
3 |

View File

@ -1,6 +1,6 @@
CompileError:
at __tests__/template.marko:2:2
at __tests__/template.marko:2:6
1 | static { console.log(x); }
> 2 | <div/>
| ^ Line has extra indentation at the beginning
| ^ Unexpected token, expected ","
3 |

View File

@ -7,8 +7,8 @@ export default {
hub: { file },
} = tag;
const rawValue = node.rawValue!;
const code = rawValue.replace(/^client\s*/, "").trim();
const start = node.name.start! + (rawValue.length - code.length);
const code = rawValue.replace(/^client\s*/, "");
const start = node.start! + (rawValue.length - code.length);
let body = parseStatements(file, code, start, start + code.length);
if (body.length === 1 && t.isBlockStatement(body[0])) {
body = body[0].body;

View File

@ -7,8 +7,8 @@ export default {
hub: { file },
} = tag;
const rawValue = node.rawValue!;
const code = rawValue.replace(/^server\s*/, "").trim();
const start = node.name.start! + (rawValue.length - code.length);
const code = rawValue.replace(/^server\s*/, "");
const start = node.start! + (rawValue.length - code.length);
let body = parseStatements(file, code, start, start + code.length);
if (body.length === 1 && t.isBlockStatement(body[0])) {
body = body[0].body;

View File

@ -7,8 +7,8 @@ export default {
hub: { file },
} = tag;
const rawValue = node.rawValue!;
const code = rawValue.replace(/^static\s*/, "").trim();
const start = node.name.start! + (rawValue.length - code.length);
const code = rawValue.replace(/^static\s*/, "");
const start = node.start! + (rawValue.length - code.length);
let body = parseStatements(file, code, start, start + code.length);
if (body.length === 1 && t.isBlockStatement(body[0])) {
body = body[0].body;

View File

@ -30,8 +30,8 @@
},
"dependencies": {
"@babel/code-frame": "^7.27.1",
"@marko/runtime-tags": "^6.0.37",
"marko": "^5.37.41"
"@marko/runtime-tags": "^6.0.42",
"marko": "^5.37.42"
},
"peerDependencies": {
"@marko/compiler": "^5.23.0"