chore: makes sources type:module ready & publish as type:module #915
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
package.json
has atype: "module"
entry(during development time we still need the flexiblity of a package.json without - so we can tests scenarios without node throwing a hissy fit)
Motivation and Context
dependency-cruiser has been ESM only since version 13. Until now it didn't advertise this in its package manifest. This is a non-standard way of doing ESM only modules. Then why didn't we do it the standard way? Well, glad you asked. Test fixtures and mocks are affected by the
"type": "module"
setting as well. As we have several tests that have .js files with commonjs in them, these got qualified as ESM - which jump-scares the nodejs ESM processor.This PR circumvents this issue by
"type": "module"
to the manifest.For this to work properly the last remnants of files still called ".js" but actually having commonjs content in
src
andconfigs
needed to be renamed to .cjs. For good measure we did the same for all other.js
module that wasn't a mock or fixture.How Has This Been Tested?
Types of changes
Checklist
📖
⚖️