Open simonihmig opened 1 week ago
Re throwing there isn't a hard requirement, i don't think. I expect library authors to be able to read their terminal output during a build. If we remove the throw, i think i'd like than message colored yellow or red or something. Thoughts?
Yeah, I patch-package'd it to do that and also output the original e.message
. Can add color and file a PR if you want!
that would be lovely! thank you!
I just noticed I never declared node support on this tool.
So... we could declare node22+ and then use the builtin styleText
?
(would be major bump, obvs)
TIL about styleText!
Seems it was added in 20.12 tho: https://nodejs.org/api/util.html#utilstyletextformat-text-options Should I end up using this pkg in some non-personal projects, it would be nice to be able to use that version of node! :wink:
node 20 it is! (i have no reason not support it, since it has the features i want haha)
For .js files (with
allowJs: true
) glint is emitting exports likeexport const foo: Foo
, instead ofexport declare const foo: Foo
(which you have test coverage for), that causes jscodeshift to throw that error. See https://github.com/facebook/jscodeshift/issues/539, which you apparently have seen already.I don't see a way to fix this properly, other than making jscodeshift be able to parse d.ts files, or reverting to Regex replacements instead of AST transforms?
What kinda helps is no not re-throw here, but just log the error and move on. At least when those js files the d.ts output has been generated for don't import gts...