naver / egjs-infinitegrid

A module used to arrange card elements including content infinitely on a grid layout.
https://naver.github.io/egjs-infinitegrid/
MIT License
2.19k stars 94 forks source link

The following packages have a svelte field in their package.json but no exports condition for svelte. #564

Open mrexodia opened 6 months ago

mrexodia commented 6 months ago

Description

23:55:01 [vite-plugin-svelte] WARNING: The following packages have a svelte field in their package.json but no exports condition for svelte.

@egjs/svelte-infinitegrid@4.11.1

Please see https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/faq.md#missing-exports-condition for details.

Steps to check or reproduce

Run npm install in a project with the latest "@egjs/svelte-infinitegrid": "^4.11.1", and "@sveltejs/vite-plugin-svelte": "^3.0.2",.

Potential fix

As usual with deprecation warnings like this the migration path is rather unclear. It looks like you need to change:

{
    "svelte": "./dist/index.js",
        "types": "./dist/index.d.ts"
}

To a construction like this (or actually you need to have both, since some tools are not compatible with this yet πŸ€¦πŸ»β€β™‚οΈ):

{
    "exports": {
        ".": {
            "types": "./dist/index.d.ts",
            "svelte": "./dist/index.js"
        }
    }
}
BlueFoxPrime commented 5 months ago

@daybrush hey! Are you planning to fix this? It’s really simple, can also open a PR if you want :)

See fix here for reference (should be backwards compatible): https://github.com/tinymce/tinymce-svelte/issues/50