From 7b21453fe0cbb271202b306ddbf0c60144ccfe58 Mon Sep 17 00:00:00 2001 From: FragsterAt Date: Tue, 22 Jul 2025 13:00:09 +0300 Subject: [PATCH 1/2] move `src` and `app` entries to the end of `path` section --- app-vite/lib/types-generator.js | 7 ++++++- app-webpack/lib/types-generator.js | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/app-vite/lib/types-generator.js b/app-vite/lib/types-generator.js index c251511d27f..8f42cf559ea 100644 --- a/app-vite/lib/types-generator.js +++ b/app-vite/lib/types-generator.js @@ -103,7 +103,12 @@ function generateTsConfig (quasarConf, fsUtils) { } const paths = {} - Object.keys(aliasMap).forEach(alias => { + Object.keys(aliasMap).sort((a,b) => // move the 'src' and 'app' entries to the end + b === 'app' ? -1 : + a === 'app' ? 1 : + b === 'src' ? -1 : + a === 'src' ? 1 : 0 + ).forEach(alias => { const rawPath = aliasMap[ alias ] const tsPath = toTsPath(rawPath) diff --git a/app-webpack/lib/types-generator.js b/app-webpack/lib/types-generator.js index 402daad870e..bc8f6f062c4 100644 --- a/app-webpack/lib/types-generator.js +++ b/app-webpack/lib/types-generator.js @@ -100,7 +100,12 @@ function generateTsConfig (quasarConf, fsUtils) { } const paths = {} - Object.keys(aliasMap).forEach(alias => { + Object.keys(aliasMap).sort((a,b) => // move the 'src' and 'app' entries to the end + b === 'app' ? -1 : + a === 'app' ? 1 : + b === 'src' ? -1 : + a === 'src' ? 1 : 0 + ).forEach(alias => { const rawPath = aliasMap[ alias ] const tsPath = toTsPath(rawPath) From 7d9dc7edfa4fdc9620754394f3789e42690494d8 Mon Sep 17 00:00:00 2001 From: FragsterAt Date: Wed, 23 Jul 2025 10:29:30 +0300 Subject: [PATCH 2/2] don't sort keys, but merge in different order --- app-vite/lib/quasar-config-file.js | 15 +++++++++++---- app-vite/lib/types-generator.js | 7 +------ app-webpack/lib/quasar-config-file.js | 15 +++++++++++---- app-webpack/lib/types-generator.js | 7 +------ 4 files changed, 24 insertions(+), 20 deletions(-) diff --git a/app-vite/lib/quasar-config-file.js b/app-vite/lib/quasar-config-file.js index 7fd98936666..050d627be8b 100644 --- a/app-vite/lib/quasar-config-file.js +++ b/app-vite/lib/quasar-config-file.js @@ -776,9 +776,6 @@ export class QuasarConfigFile { }, alias: { - '#q-app': '@quasar/app-vite', - src: appPaths.srcDir, - app: appPaths.appDir, components: appPaths.resolve.src('components'), layouts: appPaths.resolve.src('layouts'), pages: appPaths.resolve.src('pages'), @@ -791,7 +788,17 @@ export class QuasarConfigFile { strict: false, vueShim: false } - }, cfg.build) + }, + cfg.build, + // these aliases should come at the end for clean IDE autoimports + // https://github.com/quasarframework/quasar/issues/18075 + { + alias: { + '#q-app': '@quasar/app-vite', + src: appPaths.srcDir, + app: appPaths.appDir + } + }) // TODO: remove when https://github.com/vuejs/core/issues/12549 is fixed temporaryFixVueFlags(cfg.build.rawDefine) diff --git a/app-vite/lib/types-generator.js b/app-vite/lib/types-generator.js index 8f42cf559ea..c251511d27f 100644 --- a/app-vite/lib/types-generator.js +++ b/app-vite/lib/types-generator.js @@ -103,12 +103,7 @@ function generateTsConfig (quasarConf, fsUtils) { } const paths = {} - Object.keys(aliasMap).sort((a,b) => // move the 'src' and 'app' entries to the end - b === 'app' ? -1 : - a === 'app' ? 1 : - b === 'src' ? -1 : - a === 'src' ? 1 : 0 - ).forEach(alias => { + Object.keys(aliasMap).forEach(alias => { const rawPath = aliasMap[ alias ] const tsPath = toTsPath(rawPath) diff --git a/app-webpack/lib/quasar-config-file.js b/app-webpack/lib/quasar-config-file.js index 139c94fa95a..e0023cc02f4 100644 --- a/app-webpack/lib/quasar-config-file.js +++ b/app-webpack/lib/quasar-config-file.js @@ -830,9 +830,6 @@ module.exports.QuasarConfigFile = class QuasarConfigFile { }, alias: { - '#q-app': '@quasar/app-webpack', - src: appPaths.srcDir, - app: appPaths.appDir, components: appPaths.resolve.src('components'), layouts: appPaths.resolve.src('layouts'), pages: appPaths.resolve.src('pages'), @@ -845,7 +842,17 @@ module.exports.QuasarConfigFile = class QuasarConfigFile { strict: false, vueShim: false } - }, cfg.build) + }, + cfg.build, + // these aliases should come at the end for clean IDE autoimports + // https://github.com/quasarframework/quasar/issues/18075 + { + alias: { + '#q-app': '@quasar/app-webpack', + src: appPaths.srcDir, + app: appPaths.appDir + } + }) if (cfg.vendor.disable !== true) { cfg.vendor.add = cfg.vendor.add.length > 0 diff --git a/app-webpack/lib/types-generator.js b/app-webpack/lib/types-generator.js index bc8f6f062c4..402daad870e 100644 --- a/app-webpack/lib/types-generator.js +++ b/app-webpack/lib/types-generator.js @@ -100,12 +100,7 @@ function generateTsConfig (quasarConf, fsUtils) { } const paths = {} - Object.keys(aliasMap).sort((a,b) => // move the 'src' and 'app' entries to the end - b === 'app' ? -1 : - a === 'app' ? 1 : - b === 'src' ? -1 : - a === 'src' ? 1 : 0 - ).forEach(alias => { + Object.keys(aliasMap).forEach(alias => { const rawPath = aliasMap[ alias ] const tsPath = toTsPath(rawPath)