Skip to content

Commit

Permalink
feat(app-vite): tweaks on "quasar new" cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
rstoenescu committed Dec 6, 2024
1 parent f67bd66 commit 698687d
Show file tree
Hide file tree
Showing 17 changed files with 19 additions and 19 deletions.
29 changes: 14 additions & 15 deletions app-vite/lib/cmd/new.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ if (!argv.format) {

/** @type {string[]} */
const [ rawType, ...names ] = argv._
/** @type {{ format: 'default'|'ts'|'ts-options'|'ts-class'|'ts-composition'|'ts-composition-setup'}} */
/** @type {{ format: 'js'|'ts'}} */
const { format } = argv

const typeAliasMap = {
Expand Down Expand Up @@ -192,20 +192,19 @@ async function getAsset (type) {

if (fs.existsSync(targetFolder) === false) {
fse.ensureDir(targetFolder)
fse.copy(
appPaths.resolve.cli(`templates/store/${ storeProvider.name }/${ format }`),
targetFolder,
err => {
if (err) {
console.warn(err)
warn(`Could not generate ${ relativePath }.`, 'FAIL')
return
}

log(`Generated ${ relativePath }`)
log()
}
)
try {
fse.copySync(
appPaths.resolve.cli(`templates/store/${ storeProvider.name }/${ format }`),
targetFolder
)
}
catch (err) {
console.warn(err)
warn(`Could not generate ${ relativePath }.`, 'FAIL')
process.exit(1)
}

log(`Generated ${ relativePath }`)
}

return {
Expand Down
2 changes: 1 addition & 1 deletion app-vite/lib/modes/bex/bex-installation.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export async function addMode ({
fse.copySync(appPaths.resolve.cli('templates/bex/common'), appPaths.bexDir)

const hasTypescript = await cacheProxy.getModule('hasTypescript')
const format = hasTypescript ? 'ts' : 'default'
const format = hasTypescript ? 'ts' : 'js'
fse.copySync(appPaths.resolve.cli(`templates/bex/${ format }`), appPaths.bexDir)

log('Browser Extension support was added')
Expand Down
2 changes: 1 addition & 1 deletion app-vite/lib/modes/electron/electron-installation.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export async function addMode ({

log('Creating Electron source folder...')
const hasTypescript = await cacheProxy.getModule('hasTypescript')
const format = hasTypescript ? 'ts' : 'default'
const format = hasTypescript ? 'ts' : 'js'
fse.copySync(
appPaths.resolve.cli(`templates/electron/${ format }`),
appPaths.electronDir
Expand Down
2 changes: 1 addition & 1 deletion app-vite/lib/modes/pwa/pwa-installation.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export async function addMode ({

const hasTypescript = await cacheProxy.getModule('hasTypescript')
const { hasEslint } = await cacheProxy.getModule('eslint')
const format = hasTypescript ? 'ts' : 'default'
const format = hasTypescript ? 'ts' : 'js'

fse.copySync(
appPaths.resolve.cli(`templates/pwa/${ format }`),
Expand Down
2 changes: 1 addition & 1 deletion app-vite/lib/modes/ssr/ssr-installation.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export async function addMode ({

log('Creating SSR source folder...')
const hasTypescript = await cacheProxy.getModule('hasTypescript')
const format = hasTypescript ? 'ts' : 'default'
const format = hasTypescript ? 'ts' : 'js'
fse.copySync(
appPaths.resolve.cli(`templates/ssr/${ format }`),
appPaths.ssrDir
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions app-vite/templates/store/pinia/ts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { createPinia } from 'pinia'
* @see https://pinia.vuejs.org/core-concepts/plugins.html#Typing-new-store-properties
*/
declare module 'pinia' {
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
export interface PiniaCustomProperties {
// add your custom properties here, if any
}
Expand Down

0 comments on commit 698687d

Please sign in to comment.