feat(create-quasar): add TS AE template #17168
Open
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.
What kind of change does this PR introduce?
Does this PR introduce a breaking change?
The PR fulfills these requirements:
dev
branch (orv[X]
branch)Other information:
Contains fixes for app-vite&app-webpack types of AE API files, e.g. IndexAPI
Adds a TS AE template, highlights:
There is a limitation with the SFC support. When using
<script setup lang="ts">
, it won't work in JS app-webpack apps. This is because mkdist skips processing it and there is no TypeScript support in JS app-webpack, so it fails. If unjs/mkdist#210 gets released, then this limitation will become "when using<script setup lang="ts">
AND type-only macros, e.g.defineProps<QBtnProps>()
.Alternatively, to completely eliminate the limitation, we could add TS processing support to app-webpack when using JS. We may do this in the core, or via a snippet in AE index API. app-vite JS works fine due to how Vite is configured to handle TS automatically.
For now, I just left some comments explaining the limitations.
What to do next:
I haven't added the UI kit due to complexity, limitations, time constraints, etc. It can be plugged into the template in the form of another workspace entry in the monorepo later. As the AE can now also ship SFC files and act as a library that can expose methods and such, the importance of the UI kit is reduced. The only purpose of the UI kit is to support other flavors, e.g. Vite plugin, Vue CLI plugin, and UMD. UMD will be problematic regarding SFC support as AEs will ship transpiled .vue files and there is no build system to integrate those. We may need to build SFCs into .js and ship it that way for UMD, but we would need to figure out the limitations to do that.
We may also want to offer the non-monorepo version of the TS AE kit as people might want to create AEs into their existing monorepos.