framework7io / framework7

Full featured HTML framework for building iOS & Android apps
http://framework7.io
MIT License
18.13k stars 3.23k forks source link

[v7] package.json exports does not allow access to shared #3991

Closed basejump closed 2 years ago

basejump commented 2 years ago

We use the some of the helpers in shared and can't access them using vite because they are not in exports.

"exports": {
    ".": "./framework7-svelte.js",
    "./components/*": "./components/*"
  },

can it be the following, or is it even needed?

"exports": {
    ".": "./framework7-svelte.js",
    "./components/*": "./components/*",
   "./shared/*": "./shared/*"
  },
nolimits4web commented 2 years ago

what helpers do you use? what is in shared and not documented is not safe to re-use as its mostly for internal use and can be changed anytime

basejump commented 2 years ago

In and ideal world yes. Svelte doesn't really have a good way to "extend" components, so there are a few instances where its not practical to wrap one of the F7 components and is easier to just grab the source and tweak it for a new component, which means we need to ref the shared src as well. We also re-use your utils/classNames and mixins/colorClasses in many of our components. as well as rest-props/restProps . While testing v7 beta we are working around it by adding a resolve.alias to the vite config but thats not ideal. BTW, fantastic job on F7, so glad we discovered it for our project.