Skip to content

Conversation

marcusrbrown
Copy link
Contributor

I consolidated the code that writes output files into a function that:

  1. Converts the output data to a string using JSON.stringify
  2. Ensures the directory path of the output file exists
  3. Adds EOL to the end of the output data, to ensure all files are terminated with whitespace

The addition of EOL is to be consistent and avoid issues with downstream tools that have issues without EOL. There is likely an off-the-shelf package that can do detection, but os.EOL should cover Windows and everything else using \n.

@marcusrbrown
Copy link
Contributor Author

I noticed a few issues with this change so I'll convert to draft for now:

  • Extra newline from "Amalgamate" step don't add EOL at EOF if it's already there
  • Similar pattern is used in resolve.ts move the utility code to a separate file

@marcusrbrown marcusrbrown marked this pull request as draft January 28, 2022 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant