- I originally made the spoilers and while they work (and I would say
improve readability a good bit), there's also some issues with them
- I've used them a ton more now so know how to workaround most
of the issues with them now
- fix: use HTML `code` tag inside of `summary` tag, can't use backticks
- was mixing MD and HTML before, and this doesn't always work and
didn't work on GitHub, they just had backticks
- fix: don't duplicate the file name in the heading, just make the
`summary` have a heading inside it instead
- use an `h4` same as the `####` that it was before
- feat: add syntax highlighting by adding code blocks for each code
snippet
- js for rollup.config.js, json5 for tsconfig (it has comments,
trailing commas, etc (actually a custom parser, but json5 is close
enough)), json for package.json, and text for verbose logs
- also, a lot of people sometimes just paste the code with no code
block and it formats terribly, so this should help defer that
(as well as any potential issues that can crop up with unindented
blocks)
- the `envinfo` text code block seems to be working well, so
hopefully this will improve issues too
On Windows the normalized paths in resolveId end up in POSIX format.
This cause rollup to treat the returned path as a new piece of content.
This in turn results in duplicate output for references across entry points.
Fixed by normalizing the path to use host OS separators before returning.
- long logs of output or long configs are hard on the eyes and make it
difficult to read through issues as they just take up so much space
- so it would be better, in my opinion, to hide them by default with
spoiler tags, which can be opened up when further investigation is
warranted
- some issue authors have already used this pattern, this just brings
it to the template itself so everyone (hopefully) starts using it
- replace the version list with a copy+paste this envinfo command,
copy back the output
- uses a modified, shortened variant of something being used
successfully downstream in TSDX: 349f299976
- this should make reporting versions zero-effort and thereby
significantly decrease non-reporting by making the hard thing easy
- personally have experienced issues that didn't report but version
was very relevant to the issue
- also some folks report "latest" or used carets, which lack posterity
or are confusing
- previously, declarationDir was set to cwd if useTsconfigDeclarationDir
wasn't true, however, declarations aren't output to cwd, but to
Rollup's output destination, so this was incorrect
- instead, don't set declarationDir, which defaults it to outDir,
which is currently set to a placeholder
- previously, it rewrote declarations to output to Rollup's dest
from cwd, now rewrite from outDir placeholder instead
- and add a rewrite of sources to match relative path from Rollup's
output dest instead of outDir placeholder
- also change the one line in the docs that says it'll be
`process.cwd()`; every other reference says it'll be the output dest
* stop roll() from failing if the new cache has no files
Today I stumbled upon an error where it would fail when the cache folder was not present
```(typescript) Error: ENOENT: no such file or directory, rename 'REDACTED\node_modules\.cache\rollup-plugin-typescript2/rpt2_759e2fd8d3f20c1a0805faf5404af6bea36632fd/code/cache_' -> 'REDACTED\node_modules\.cache\rollup-plugin-typescript2/rpt2_759e2fd8d3f20c1a0805faf5404af6bea36632fd/code/cache'```
This PR fixes it by checking its existence before trying to rename it
* use existsSync instead of fs.existsSync
* use renameSync instead of fs.renameSync