Skip to content

Commit ef35a35

Browse files
committed
chore: wip
1 parent 5fdbe4f commit ef35a35

File tree

7 files changed

+29
-11
lines changed

7 files changed

+29
-11
lines changed

.stacks/core/utils/src/glob.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as glob } from 'fast-glob'

.stacks/core/utils/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export * from './delete'
66
export * from './equal'
77
export * from './export-size'
88
export * from './function'
9+
export * from './glob'
910
export * from './guards'
1011
export * from './helpers'
1112
export * from './macroable'

.stacks/core/utils/src/vendors.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,5 +221,4 @@ export {
221221
renderHeadToString,
222222
} from '@vueuse/head'
223223

224-
export { default as glob } from 'fast-glob'
225224
export { default as readableSize } from 'pretty-bytes'

.stacks/core/vite/src/plugin/auto-imports.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import AutoImport from 'unplugin-auto-import/vite'
22
import { defu } from 'defu'
33
import type { AutoImportsOptions } from '@stacksjs/types'
4-
import { path as p } from '@stacksjs/path'
4+
import { frameworkPath, resourcesPath } from '@stacksjs/path'
5+
import type { Plugin } from 'vite'
56

67
export function autoImports(options?: AutoImportsOptions): Plugin {
78
const defaultOptions: AutoImportsOptions = {
@@ -13,13 +14,13 @@ export function autoImports(options?: AutoImportsOptions): Plugin {
1314
// { '@stacksjs/validation': ['validate', 'validateAll', 'validateSync', 'validateAllSync'] },
1415
],
1516
dirs: [
16-
// p.resourcesPath('functions'),
17-
// p.resourcesPath('components'),
17+
resourcesPath('functions'),
18+
resourcesPath('components'),
1819

1920
// here, we say that everything that lives here in .stacks/src/index.ts will be auto-imported
20-
p.frameworkPath('src'),
21+
frameworkPath('src'),
2122
],
22-
dts: p.frameworkPath('types/auto-imports.d.ts'),
23+
dts: frameworkPath('types/auto-imports.d.ts'),
2324
vueTemplate: true,
2425
eslintrc: {
2526
enabled: false,

.stacks/types/auto-imports.d.ts

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ declare global {
117117
const copyFolder: typeof import('../core/storage/src/copy')['copyFolder']
118118
const coreEnvPath: typeof import('../core/path/src/index')['coreEnvPath']
119119
const corePath: typeof import('../core/path/src/index')['corePath']
120+
const count: typeof import('../../resources/functions/counter')['count']
120121
const createApp: typeof import('vue')['createApp']
121122
const createControlledPromise: typeof import('../core/utils/src/promise')['createControlledPromise']
122123
const createEventHook: typeof import('../core/utils/src/vendors')['createEventHook']
@@ -269,7 +270,7 @@ declare global {
269270
const getSSRHandler: typeof import('../core/utils/src/vendors')['getSSRHandler']
270271
const getTypeName: typeof import('../core/utils/src/base')['getTypeName']
271272
const gitPath: typeof import('../core/path/src/index')['gitPath']
272-
const glob: typeof import('../core/utils/src/vendors')['glob']
273+
const glob: typeof import('../core/utils/src/glob')['glob']
273274
const goToNextPage: typeof import('../core/search-engine/src/index')['goToNextPage']
274275
const goToPage: typeof import('../core/search-engine/src/index')['goToPage']
275276
const goToPrevPage: typeof import('../core/search-engine/src/index')['goToPrevPage']
@@ -292,6 +293,7 @@ declare global {
292293
const helpers: typeof import('../core/storage/src/helpers')['helpers']
293294
const hits: typeof import('../core/search-engine/src/index')['hits']
294295
const ignorableWatch: typeof import('../core/utils/src/vendors')['ignorableWatch']
296+
const increment: typeof import('../../resources/functions/counter')['increment']
295297
const index: typeof import('../core/search-engine/src/index')['index']
296298
const initProject: typeof import('../core/utils/src/helpers')['initProject']
297299
const inject: typeof import('vue')['inject']
@@ -301,6 +303,7 @@ declare global {
301303
const isArray: typeof import('../core/validation/src/is')['isArray']
302304
const isBoolean: typeof import('../core/validation/src/is')['isBoolean']
303305
const isBrowser: typeof import('../core/validation/src/is')['isBrowser']
306+
const isDark: typeof import('../../resources/functions/dark')['isDark']
304307
const isDate: typeof import('../core/validation/src/is')['isDate']
305308
const isDeepEqual: typeof import('../core/utils/src/equal')['isDeepEqual']
306309
const isDef: typeof import('../core/validation/src/is')['isDef']
@@ -439,6 +442,7 @@ declare global {
439442
const paymentsPath: typeof import('../core/path/src/index')['paymentsPath']
440443
const perPage: typeof import('../core/search-engine/src/index')['perPage']
441444
const plivo: typeof import('../core/notifications/sms/src/drivers/index')['plivo']
445+
const preferredDark: typeof import('../../resources/functions/dark')['preferredDark']
442446
const presetForms: typeof import('../core/ui/src/index')['presetForms']
443447
const projectConfigPath: typeof import('../core/path/src/index')['projectConfigPath']
444448
const projectPath: typeof import('../core/path/src/index')['projectPath']
@@ -545,6 +549,7 @@ declare global {
545549
const toString: typeof import('../core/utils/src/base')['toString']
546550
const toUnits: typeof import('../core/utils/src/currency')['toUnits']
547551
const toValue: typeof import('vue')['toValue']
552+
const toggleDark: typeof import('../../resources/functions/dark')['toggleDark']
548553
const totalPages: typeof import('../core/search-engine/src/index')['totalPages']
549554
const transformerCompileClass: typeof import('../core/ui/src/index')['transformerCompileClass']
550555
const triggerRef: typeof import('vue')['triggerRef']
@@ -874,6 +879,7 @@ declare module 'vue' {
874879
readonly copyFolder: UnwrapRef<typeof import('../core/storage/src/copy')['copyFolder']>
875880
readonly coreEnvPath: UnwrapRef<typeof import('../core/path/src/index')['coreEnvPath']>
876881
readonly corePath: UnwrapRef<typeof import('../core/path/src/index')['corePath']>
882+
readonly count: UnwrapRef<typeof import('../../resources/functions/counter')['count']>
877883
readonly createApp: UnwrapRef<typeof import('vue')['createApp']>
878884
readonly createControlledPromise: UnwrapRef<typeof import('../core/utils/src/promise')['createControlledPromise']>
879885
readonly createEventHook: UnwrapRef<typeof import('../core/utils/src/vendors')['createEventHook']>
@@ -1020,7 +1026,7 @@ declare module 'vue' {
10201026
readonly getSSRHandler: UnwrapRef<typeof import('../core/utils/src/vendors')['getSSRHandler']>
10211027
readonly getTypeName: UnwrapRef<typeof import('../core/utils/src/base')['getTypeName']>
10221028
readonly gitPath: UnwrapRef<typeof import('../core/path/src/index')['gitPath']>
1023-
readonly glob: UnwrapRef<typeof import('../core/utils/src/vendors')['glob']>
1029+
readonly glob: UnwrapRef<typeof import('../core/utils/src/glob')['glob']>
10241030
readonly goToNextPage: UnwrapRef<typeof import('../core/search-engine/src/index')['goToNextPage']>
10251031
readonly goToPage: UnwrapRef<typeof import('../core/search-engine/src/index')['goToPage']>
10261032
readonly goToPrevPage: UnwrapRef<typeof import('../core/search-engine/src/index')['goToPrevPage']>
@@ -1043,6 +1049,7 @@ declare module 'vue' {
10431049
readonly helpers: UnwrapRef<typeof import('../core/storage/src/helpers')['helpers']>
10441050
readonly hits: UnwrapRef<typeof import('../core/search-engine/src/index')['hits']>
10451051
readonly ignorableWatch: UnwrapRef<typeof import('../core/utils/src/vendors')['ignorableWatch']>
1052+
readonly increment: UnwrapRef<typeof import('../../resources/functions/counter')['increment']>
10461053
readonly index: UnwrapRef<typeof import('../core/search-engine/src/index')['index']>
10471054
readonly initProject: UnwrapRef<typeof import('../core/utils/src/helpers')['initProject']>
10481055
readonly inject: UnwrapRef<typeof import('vue')['inject']>
@@ -1052,6 +1059,7 @@ declare module 'vue' {
10521059
readonly isArray: UnwrapRef<typeof import('../core/validation/src/is')['isArray']>
10531060
readonly isBoolean: UnwrapRef<typeof import('../core/validation/src/is')['isBoolean']>
10541061
readonly isBrowser: UnwrapRef<typeof import('../core/validation/src/is')['isBrowser']>
1062+
readonly isDark: UnwrapRef<typeof import('../../resources/functions/dark')['isDark']>
10551063
readonly isDate: UnwrapRef<typeof import('../core/validation/src/is')['isDate']>
10561064
readonly isDeepEqual: UnwrapRef<typeof import('../core/utils/src/equal')['isDeepEqual']>
10571065
readonly isDef: UnwrapRef<typeof import('../core/validation/src/is')['isDef']>
@@ -1189,6 +1197,7 @@ declare module 'vue' {
11891197
readonly paymentsPath: UnwrapRef<typeof import('../core/path/src/index')['paymentsPath']>
11901198
readonly perPage: UnwrapRef<typeof import('../core/search-engine/src/index')['perPage']>
11911199
readonly plivo: UnwrapRef<typeof import('../core/notifications/sms/src/drivers/index')['plivo']>
1200+
readonly preferredDark: UnwrapRef<typeof import('../../resources/functions/dark')['preferredDark']>
11921201
readonly presetForms: UnwrapRef<typeof import('../core/ui/src/index')['presetForms']>
11931202
readonly projectConfigPath: UnwrapRef<typeof import('../core/path/src/index')['projectConfigPath']>
11941203
readonly projectPath: UnwrapRef<typeof import('../core/path/src/index')['projectPath']>
@@ -1295,6 +1304,7 @@ declare module 'vue' {
12951304
readonly toString: UnwrapRef<typeof import('../core/utils/src/base')['toString']>
12961305
readonly toUnits: UnwrapRef<typeof import('../core/utils/src/currency')['toUnits']>
12971306
readonly toValue: UnwrapRef<typeof import('vue')['toValue']>
1307+
readonly toggleDark: UnwrapRef<typeof import('../../resources/functions/dark')['toggleDark']>
12981308
readonly totalPages: UnwrapRef<typeof import('../core/search-engine/src/index')['totalPages']>
12991309
readonly transformerCompileClass: UnwrapRef<typeof import('../core/ui/src/index')['transformerCompileClass']>
13001310
readonly triggerRef: UnwrapRef<typeof import('vue')['triggerRef']>
@@ -1618,6 +1628,7 @@ declare module '@vue/runtime-core' {
16181628
readonly copyFolder: UnwrapRef<typeof import('../core/storage/src/copy')['copyFolder']>
16191629
readonly coreEnvPath: UnwrapRef<typeof import('../core/path/src/index')['coreEnvPath']>
16201630
readonly corePath: UnwrapRef<typeof import('../core/path/src/index')['corePath']>
1631+
readonly count: UnwrapRef<typeof import('../../resources/functions/counter')['count']>
16211632
readonly createApp: UnwrapRef<typeof import('vue')['createApp']>
16221633
readonly createControlledPromise: UnwrapRef<typeof import('../core/utils/src/promise')['createControlledPromise']>
16231634
readonly createEventHook: UnwrapRef<typeof import('../core/utils/src/vendors')['createEventHook']>
@@ -1764,7 +1775,7 @@ declare module '@vue/runtime-core' {
17641775
readonly getSSRHandler: UnwrapRef<typeof import('../core/utils/src/vendors')['getSSRHandler']>
17651776
readonly getTypeName: UnwrapRef<typeof import('../core/utils/src/base')['getTypeName']>
17661777
readonly gitPath: UnwrapRef<typeof import('../core/path/src/index')['gitPath']>
1767-
readonly glob: UnwrapRef<typeof import('../core/utils/src/vendors')['glob']>
1778+
readonly glob: UnwrapRef<typeof import('../core/utils/src/glob')['glob']>
17681779
readonly goToNextPage: UnwrapRef<typeof import('../core/search-engine/src/index')['goToNextPage']>
17691780
readonly goToPage: UnwrapRef<typeof import('../core/search-engine/src/index')['goToPage']>
17701781
readonly goToPrevPage: UnwrapRef<typeof import('../core/search-engine/src/index')['goToPrevPage']>
@@ -1787,6 +1798,7 @@ declare module '@vue/runtime-core' {
17871798
readonly helpers: UnwrapRef<typeof import('../core/storage/src/helpers')['helpers']>
17881799
readonly hits: UnwrapRef<typeof import('../core/search-engine/src/index')['hits']>
17891800
readonly ignorableWatch: UnwrapRef<typeof import('../core/utils/src/vendors')['ignorableWatch']>
1801+
readonly increment: UnwrapRef<typeof import('../../resources/functions/counter')['increment']>
17901802
readonly index: UnwrapRef<typeof import('../core/search-engine/src/index')['index']>
17911803
readonly initProject: UnwrapRef<typeof import('../core/utils/src/helpers')['initProject']>
17921804
readonly inject: UnwrapRef<typeof import('vue')['inject']>
@@ -1796,6 +1808,7 @@ declare module '@vue/runtime-core' {
17961808
readonly isArray: UnwrapRef<typeof import('../core/validation/src/is')['isArray']>
17971809
readonly isBoolean: UnwrapRef<typeof import('../core/validation/src/is')['isBoolean']>
17981810
readonly isBrowser: UnwrapRef<typeof import('../core/validation/src/is')['isBrowser']>
1811+
readonly isDark: UnwrapRef<typeof import('../../resources/functions/dark')['isDark']>
17991812
readonly isDate: UnwrapRef<typeof import('../core/validation/src/is')['isDate']>
18001813
readonly isDeepEqual: UnwrapRef<typeof import('../core/utils/src/equal')['isDeepEqual']>
18011814
readonly isDef: UnwrapRef<typeof import('../core/validation/src/is')['isDef']>
@@ -1933,6 +1946,7 @@ declare module '@vue/runtime-core' {
19331946
readonly paymentsPath: UnwrapRef<typeof import('../core/path/src/index')['paymentsPath']>
19341947
readonly perPage: UnwrapRef<typeof import('../core/search-engine/src/index')['perPage']>
19351948
readonly plivo: UnwrapRef<typeof import('../core/notifications/sms/src/drivers/index')['plivo']>
1949+
readonly preferredDark: UnwrapRef<typeof import('../../resources/functions/dark')['preferredDark']>
19361950
readonly presetForms: UnwrapRef<typeof import('../core/ui/src/index')['presetForms']>
19371951
readonly projectConfigPath: UnwrapRef<typeof import('../core/path/src/index')['projectConfigPath']>
19381952
readonly projectPath: UnwrapRef<typeof import('../core/path/src/index')['projectPath']>
@@ -2039,6 +2053,7 @@ declare module '@vue/runtime-core' {
20392053
readonly toString: UnwrapRef<typeof import('../core/utils/src/base')['toString']>
20402054
readonly toUnits: UnwrapRef<typeof import('../core/utils/src/currency')['toUnits']>
20412055
readonly toValue: UnwrapRef<typeof import('vue')['toValue']>
2056+
readonly toggleDark: UnwrapRef<typeof import('../../resources/functions/dark')['toggleDark']>
20422057
readonly totalPages: UnwrapRef<typeof import('../core/search-engine/src/index')['totalPages']>
20432058
readonly transformerCompileClass: UnwrapRef<typeof import('../core/ui/src/index')['transformerCompileClass']>
20442059
readonly triggerRef: UnwrapRef<typeof import('vue')['triggerRef']>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<template>
22
<div />
3-
<!-- <button
3+
<button
44
class="btn"
55
@click="toggleDark()"
66
>
77
<div class="i-heroicons-outline-sun dark:i-heroicons-outline-moon" />
8-
</button> -->
8+
</button>
99
</template>

resources/components/HelloWorld.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// which properties does your component accept?
33
const { greeting = 'Welcome!' } = defineProps<{
44
showButtons: boolean
5+
greeting: string
56
}>()
67
78
// easily use any of the lifecycle hooks without needing to import them

0 commit comments

Comments
 (0)