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