vendure-ecommerce / vendure

The commerce platform with customization in its DNA.
https://www.vendure.io
Other
5.61k stars 996 forks source link

Separate tsconfig-file to allow ui-folders in the dev compilation (npx vendure create -template). #3015

Open KariNarhi28 opened 1 month ago

KariNarhi28 commented 1 month ago

Is your feature request related to a problem? Please describe. As is recommended, the UI-folders of plugins should be excluded from the tsconfig-compilation since those are compiled into the Admin UI instead of the server.

However, this creates an issue with the tsconfig settings not having having an effect on the files under ui-folder.

For example, I do not get errors for unused local variables and I do not get suggestions for imports from different packages, instead I have to manually type the imports.

Describe the solution you'd like A new configuration that allows having the ui-folders included for development, but excluded for build.

E.g tsconfig.build.json:

{
  "extends":"./tsconfig.json",
   "exclude": [ 
      "src/plugins/**/ui/*",
       "etc..."
   ]
}

The different tsconfig-files should be then handled with tsc -p <tsconfig-file path>

In a nutshell, 3 tsconfig-files are needed:

The last 2 would be otherwise same, but with ui-folder excluded only for the other one used with ts-node

Describe alternatives you've considered Separate the Admin UI / plugins from the server compilation context into it's own app-project. Might be related to the planned(?) Storefront / Admin UI SDK which should come sometime in distant future.

Additional context With the current way of handling the exclusion of ui-folder, the plugin development is more difficult without the help of tsconfig-features.

dlhck commented 1 day ago

Could be done together with #2903