-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(create-quasar): add TS AE template #17168
feat(create-quasar): add TS AE template #17168
Conversation
fee972d
to
8835eaf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.gitignore
file is missing into templates/app-extension/ae-ts/BASE
Example content:
.DS_Store
.thumbs.db
node_modules
dist
# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Editor directories and files
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
This is important since we now auto-initialize a Git repo when the scaffolding completes
Latest commits and in general some package.json
lines assume the dev will be using pnpm
E.g. workspace:*
would break installation with npm
and yarn
For npm
it seems that using ^0.0.1
would be fine to get past deps installation, I couldn't find a way to say "just take the latest available in the repository"
I haven't tested this with Bun
This needs to be fixed before merging
Btw, I simulated the usage of different package managers with this command, to get runningPackageManager
filled in with some actual values
npm_config_user_agent=npm/10.5.0 node <path-to-quasar-folder>/quasar/create-quasar/index.js
I haven't explored how hard it would be to implement this, but we should explore at some point running the root level format
command after deps installation but before linting
This should probably be done automatically and for all create-coralloy
templates, if a format
script actually exists, without an option to let the user choose
I went ahead, rebased the PR and fixed a couple of my own comments in my local copy
If you're ok with it, I can force-push the rebase and my commits for you
If this is fixed, I can ping Daniel about it and see if we can get it in
When running the AE build
command, I got a warning from mkdist
about installing vue-tsc
to get proper typings for components, or something similar
Are you aware of it?
create-quasar/templates/app-extension/ae-ts/BASE/playground/quasar-cli-vite/README.md
Show resolved
Hide resolved
"dependencies": { | ||
"@quasar/extras": "^1.16.11", | ||
"quasar": "^2.15.2", | ||
"<%= pkgName %>": "workspace:*", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work with npm
and yarn
too?
Isn't workspace:*
a pnpm
thing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so. The template was pnpm only at first. It seems I've overlooked this part. I will think about it and do some research. yarn v1 should auto-link them. Not sure how npm does it. Should be solvable with some if-else rendering.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
create-quasar/templates/app-extension/ae-ts/BASE/playground/quasar-cli-webpack/README.md
Show resolved
Hide resolved
create-quasar/templates/app-extension/ae-ts/BASE/playground/quasar-cli-webpack/_package.json
Outdated
Show resolved
Hide resolved
create-quasar/templates/app-extension/ae-ts/BASE/playground/quasar-cli-webpack/_tsconfig.json
Outdated
Show resolved
Hide resolved
...e-quasar/templates/app-extension/ae-ts/BASE/playground/quasar-cli-webpack/postcss.config.cjs
Show resolved
Hide resolved
create-quasar/templates/app-extension/ae-ts/BASE/playground/quasar-cli-webpack/src/quasar.d.ts
Show resolved
Hide resolved
they should not be built regularly using JS, TS, Vue, etc. loaders they should be copied as is, so we adjust the scripts and use a non-existing 'raw' loader as a workaround
69ce67f
to
726a994
Compare
Check out latest commits in this branch, where I pushed some fixes for the problems I highlighted |
I already had rebased it and made some changes. They were waiting locally. So, I force-pushed them instead. Thanks. I will check the changes for other bits that I haven't addressed.
I've done it myself, thanks.
Just FYI,
It's a recent change. I've noticed it recently, after returning for the final touches. Installing it didn't make any difference for the test component. But, I'll add vue-tsc to the template, to avoid the warning and just in case.
We used to run the format script, but probably after listing. It was probably a very long time ago. Maybe it was lost while migrating from starter-kit to create-quasar. It wasn't really hard to do so. Running it after linting is better, when ESLint auto-fixes some stuff. For example, if there is an unused eslint-disable comment, ESLint removes the comment, leaving the line empty. Running the format script afterward, clean up those empty lines, and adjust other styles if needed. Do you have any reason why do you want to run linting before formatting? |
Honestly, your reasoning makes much more sense than my own thoughts |
not sure how it actually affects the end result, but there is a warning otherwise
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Posted two comments earlier
Regarding the instructions for getting started in the CLI message, I'll check it out. The package manager stuff is like that because it uses the detected package manager to scaffold stuff accordingly. The selection only happens after the scaffolding is complete, so we can't use it with how the code is structured now. So, do you think we should leave it as is? Should I rework how package manager selection happens to scaffold stuff accordingly? Should I do something else? |
Quoting from my first comment
Use this to test out how users will actually experience this Maybe we can add a couple scripts on |
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.