Skip to content

Conversation

@vdegenne
Copy link

@vdegenne vdegenne commented Mar 17, 2023

Hello

I know you are not maintaining this package anymore,

But at least can you accept this change?
Your package is written using ES Module in the source, the new specs want developers to update their package.json to explicitly specify this (using "type": "module"). This helps the node module resolver to find the right file to import inside a project that depends on your package. It also helps bundlers and other analyzer tools to properly include the file in the process.

I also changed the property main because it pointed to the compiled version of your package which is incorrect. it has to point to the index file of your source in most case because that's what the node module resolver is looking for in an interconnected modules ecosystem.

Without that people wanting to use your package inside their building process have to write:

import gamepad from 'gamecontroller.js/src/index.js';

This change will allow them to write:

import gamepad from 'gamecontroller.js';

@vdegenne
Copy link
Author

vdegenne commented Mar 17, 2023

For

import gamepad from 'gamecontroller.js';

to actually work, you would also need to export a default from the index which is gameControl. I updated that.

The great news is that it will not affect projects already relying on your package, this update is backward compatible.

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