stacks 0.52.0 → 0.52.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/auto-imports.d.ts +1595 -651
- package/components.d.ts +4 -2
- package/core/actions/build.config.ts +2 -0
- package/core/actions/package.json +14 -2
- package/core/actions/src/clean.ts +9 -12
- package/core/actions/src/deploy/domains.ts +1 -1
- package/core/actions/src/helpers/package-json.ts +1 -2
- package/core/actions/src/helpers/utils.ts +1 -2
- package/core/actions/src/release.ts +1 -1
- package/core/actions/src/tinker.ts +1 -0
- package/core/ai/build.config.ts +2 -0
- package/core/ai/package.json +1 -1
- package/core/alias/build.config.ts +2 -0
- package/core/alias/package.json +1 -2
- package/core/analytics/build.config.ts +2 -0
- package/core/analytics/package.json +1 -1
- package/core/arrays/build.config.ts +2 -0
- package/core/arrays/package.json +1 -1
- package/core/auth/build.config.ts +2 -0
- package/core/auth/package.json +1 -1
- package/core/auth/src/index.ts +1 -3
- package/core/buddy/README.md +1 -1
- package/core/buddy/package.json +1 -1
- package/core/buddy/src/commands/build.ts +8 -11
- package/core/buddy/src/commands/changelog.ts +4 -5
- package/core/buddy/src/commands/clean.ts +2 -3
- package/core/buddy/src/commands/deploy.ts +4 -5
- package/core/buddy/src/commands/dev.ts +2 -1
- package/core/buddy/src/commands/fresh.ts +2 -2
- package/core/buddy/src/commands/inspire.ts +4 -5
- package/core/buddy/src/commands/key.ts +4 -5
- package/core/buddy/src/commands/lint.ts +8 -10
- package/core/buddy/src/commands/make.ts +4 -5
- package/core/buddy/src/commands/migrate.ts +4 -5
- package/core/buddy/src/commands/onboarding.ts +4 -5
- package/core/buddy/src/commands/release.ts +4 -12
- package/core/buddy/src/commands/seed.ts +14 -14
- package/core/buddy/src/commands/setting.ts +4 -5
- package/core/buddy/src/commands/test.ts +29 -34
- package/core/buddy/src/commands/upgrade.ts +13 -16
- package/core/buddy/src/commands/version.ts +25 -16
- package/core/build/build.config.ts +2 -0
- package/core/build/node_modules/.bin/vite +4 -4
- package/core/build/node_modules/.bin/vite-ssg +4 -4
- package/core/build/node_modules/.bin/vue-docgen-web-types +4 -4
- package/core/build/package.json +5 -5
- package/core/build/src/stacks.ts +8 -14
- package/core/build/src/vue-components.ts +6 -4
- package/core/cache/build.config.ts +2 -0
- package/core/cache/package.json +2 -2
- package/core/chat/build.config.ts +2 -0
- package/core/chat/package.json +6 -6
- package/core/cli/package.json +1 -1
- package/core/cli/src/actions/install.ts +20 -2
- package/core/cli/src/helpers.ts +6 -1
- package/core/cli/src/run.ts +5 -8
- package/core/cloud/build.config.ts +2 -0
- package/core/cloud/package.json +1 -1
- package/core/collections/build.config.ts +2 -0
- package/core/collections/package.json +1 -1
- package/core/config/package.json +1 -1
- package/core/config/src/defaults.ts +0 -2
- package/core/config/src/stacks.ts +9 -2
- package/core/database/package.json +1 -1
- package/core/database/src/migrations/index.ts +2 -1
- package/core/datetime/package.json +1 -1
- package/core/desktop/build.config.ts +2 -0
- package/core/desktop/package.json +2 -2
- package/core/development/build.config.ts +2 -0
- package/core/development/package.json +6 -6
- package/core/docs/build.config.ts +1 -0
- package/core/docs/node_modules/.bin/vitepress +4 -4
- package/core/docs/package.json +2 -2
- package/core/domains/build.config.ts +2 -0
- package/core/domains/package.json +1 -1
- package/core/email/package.json +12 -12
- package/core/email/src/drivers/mailjet.ts +1 -0
- package/core/email/src/tailwind.config.ts +1 -1
- package/core/error-handling/package.json +2 -2
- package/core/events/package.json +1 -1
- package/core/faker/build.config.ts +2 -0
- package/core/faker/package.json +1 -1
- package/core/git/build.config.ts +2 -0
- package/core/git/package.json +1 -1
- package/core/health/build.config.ts +2 -0
- package/core/health/package.json +1 -1
- package/core/lint/build.config.ts +2 -0
- package/core/lint/node_modules/.bin/eslint +4 -4
- package/core/lint/package.json +3 -3
- package/core/lint/src/index.ts +1 -1
- package/core/logging/package.json +5 -5
- package/core/modules/build.config.ts +2 -0
- package/core/modules/package.json +1 -1
- package/core/notifications/package.json +22 -22
- package/core/notifications/src/index.ts +5 -8
- package/core/objects/build.config.ts +2 -0
- package/core/objects/package.json +1 -1
- package/core/orm/package.json +1 -1
- package/core/pages/build.config.ts +2 -0
- package/core/pages/package.json +1 -1
- package/core/path/build.config.ts +1 -0
- package/core/path/package.json +1 -1
- package/core/payments/build.config.ts +2 -0
- package/core/payments/package.json +2 -2
- package/core/push/build.config.ts +2 -0
- package/core/push/package.json +3 -3
- package/core/query-builder/build.config.ts +2 -0
- package/core/query-builder/package.json +1 -1
- package/core/queue/build.config.ts +2 -0
- package/core/queue/package.json +1 -1
- package/core/realtime/build.config.ts +2 -0
- package/core/realtime/package.json +1 -1
- package/core/router/build.config.ts +2 -0
- package/core/router/package.json +2 -2
- package/core/router/src/index.ts +114 -11
- package/core/scheduler/build.config.ts +2 -0
- package/core/scheduler/package.json +1 -1
- package/core/search-engine/build.config.ts +1 -0
- package/core/search-engine/package.json +1 -1
- package/core/search-engine/src/index.ts +1 -22
- package/core/security/build.config.ts +2 -0
- package/core/security/package.json +1 -1
- package/core/server/build.config.ts +2 -0
- package/core/server/node_modules/.bin/nitro +4 -4
- package/core/server/node_modules/.bin/nitropack +4 -4
- package/core/server/node_modules/.bin/vite +4 -4
- package/core/server/package.json +3 -3
- package/core/signals/build.config.ts +2 -0
- package/core/signals/package.json +1 -1
- package/core/slug/build.config.ts +2 -0
- package/core/slug/package.json +1 -1
- package/core/sms/build.config.ts +2 -0
- package/core/sms/package.json +11 -11
- package/core/storage/build.config.ts +2 -0
- package/core/storage/package.json +1 -1
- package/core/storage/src/index.ts +11 -1
- package/core/strings/package.json +1 -1
- package/core/strings/src/index.ts +0 -1
- package/core/testing/build.config.ts +2 -0
- package/core/testing/node_modules/.bin/vitest +4 -4
- package/core/testing/package.json +4 -4
- package/core/testing/src/index.ts +1 -0
- package/core/tinker/package.json +1 -1
- package/core/types/build.config.ts +2 -0
- package/core/types/node_modules/.bin/vite +4 -4
- package/core/types/node_modules/.bin/vite-ssg +4 -4
- package/core/types/node_modules/.bin/vitepress +4 -4
- package/core/types/package.json +7 -7
- package/core/types/src/cli.ts +10 -9
- package/core/types/src/fs.ts +8 -0
- package/core/types/src/router.ts +22 -0
- package/core/types/src/stacks.ts +3 -3
- package/core/ui/build.config.ts +2 -0
- package/core/ui/package.json +3 -3
- package/core/ui/src/index.ts +1 -1
- package/core/utils/build.config.ts +2 -0
- package/core/utils/node_modules/.bin/rimraf +4 -4
- package/core/utils/package.json +3 -3
- package/core/utils/src/base.ts +6 -5
- package/core/utils/src/config.ts +2 -3
- package/core/utils/src/currency.ts +26 -0
- package/core/utils/src/delete.ts +3 -0
- package/core/utils/src/helpers.ts +2 -2
- package/core/utils/src/index.ts +7 -9
- package/core/utils/src/math.ts +30 -0
- package/core/utils/src/throttle.ts +3 -6
- package/core/utils/src/vendors.ts +221 -0
- package/core/utils/src/versions.ts +1 -0
- package/core/validation/build.config.ts +2 -0
- package/core/validation/package.json +1 -1
- package/core/validation/src/index.ts +2 -29
- package/core/{strings/src/validation.ts → validation/src/is.ts} +83 -8
- package/core/validation/src/validate.ts +29 -0
- package/docs/node_modules/.bin/rimraf +4 -4
- package/docs/node_modules/.bin/vitepress +4 -4
- package/docs/package.json +2 -2
- package/package.json +93 -46
- package/vitest.config.ts +25 -17
- package/core/utils/src/is.ts +0 -83
- package/tests/feature/example.spec.ts +0 -20
- package/tests/unit/example.test.ts +0 -7
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
export {
|
|
2
|
+
asyncComputed,
|
|
3
|
+
breakpointsAntDesign,
|
|
4
|
+
breakpointsBootstrapV5,
|
|
5
|
+
breakpointsMasterCss,
|
|
6
|
+
breakpointsQuasar,
|
|
7
|
+
breakpointsSematic,
|
|
8
|
+
breakpointsTailwind,
|
|
9
|
+
breakpointsVuetify,
|
|
10
|
+
cloneFnJSON,
|
|
11
|
+
computedAsync,
|
|
12
|
+
computedInject,
|
|
13
|
+
createFetch,
|
|
14
|
+
createReusableTemplate,
|
|
15
|
+
createTemplatePromise,
|
|
16
|
+
createUnrefFn,
|
|
17
|
+
customStorageEventName,
|
|
18
|
+
defaultDocument,
|
|
19
|
+
defaultLocation,
|
|
20
|
+
defaultNavigator,
|
|
21
|
+
defaultWindow,
|
|
22
|
+
executeTransition,
|
|
23
|
+
formatTimeAgo,
|
|
24
|
+
getSSRHandler,
|
|
25
|
+
mapGamepadToXbox360Controller,
|
|
26
|
+
onClickOutside,
|
|
27
|
+
onKeyDown,
|
|
28
|
+
onKeyPressed,
|
|
29
|
+
onKeyStroke,
|
|
30
|
+
onKeyUp,
|
|
31
|
+
onLongPress,
|
|
32
|
+
onStartTyping,
|
|
33
|
+
setSSRHandler,
|
|
34
|
+
templateRef,
|
|
35
|
+
unrefElement,
|
|
36
|
+
useActiveElement,
|
|
37
|
+
useAnimate,
|
|
38
|
+
useAsyncQueue,
|
|
39
|
+
useAsyncState,
|
|
40
|
+
useBase64,
|
|
41
|
+
useBattery,
|
|
42
|
+
useBluetooth,
|
|
43
|
+
useBreakpoints,
|
|
44
|
+
useBroadcastChannel,
|
|
45
|
+
useBrowserLocation,
|
|
46
|
+
useCached,
|
|
47
|
+
useClipboard,
|
|
48
|
+
useCloned,
|
|
49
|
+
useColorMode,
|
|
50
|
+
useConfirmDialog,
|
|
51
|
+
useCssVar,
|
|
52
|
+
useCurrentElement,
|
|
53
|
+
useCycleList,
|
|
54
|
+
useDark,
|
|
55
|
+
useDebouncedRefHistory,
|
|
56
|
+
useDeviceMotion,
|
|
57
|
+
useDeviceOrientation,
|
|
58
|
+
useDevicePixelRatio,
|
|
59
|
+
useDevicesList,
|
|
60
|
+
useDisplayMedia,
|
|
61
|
+
useDocumentVisibility,
|
|
62
|
+
useDraggable,
|
|
63
|
+
useDropZone,
|
|
64
|
+
useElementBounding,
|
|
65
|
+
useElementByPoint,
|
|
66
|
+
useElementHover,
|
|
67
|
+
useElementSize,
|
|
68
|
+
useElementVisibility,
|
|
69
|
+
useEventBus,
|
|
70
|
+
useEventListener,
|
|
71
|
+
useEventSource,
|
|
72
|
+
useEyeDropper,
|
|
73
|
+
useFavicon,
|
|
74
|
+
useFetch,
|
|
75
|
+
useFileDialog,
|
|
76
|
+
useFileSystemAccess,
|
|
77
|
+
useFocus,
|
|
78
|
+
useFocusWithin,
|
|
79
|
+
useFps,
|
|
80
|
+
useFullscreen,
|
|
81
|
+
useGamepad,
|
|
82
|
+
useGeolocation,
|
|
83
|
+
useIdle,
|
|
84
|
+
useImage,
|
|
85
|
+
useInfiniteScroll,
|
|
86
|
+
useIntersectionObserver,
|
|
87
|
+
useKeyModifier,
|
|
88
|
+
useLocalStorage,
|
|
89
|
+
useMagicKeys,
|
|
90
|
+
useManualRefHistory,
|
|
91
|
+
useMediaControls,
|
|
92
|
+
useMediaQuery,
|
|
93
|
+
useMemoize,
|
|
94
|
+
useMemory,
|
|
95
|
+
useMounted,
|
|
96
|
+
useMouse,
|
|
97
|
+
useMouseInElement,
|
|
98
|
+
useMousePressed,
|
|
99
|
+
useMutationObserver,
|
|
100
|
+
useNavigatorLanguage,
|
|
101
|
+
useNetwork,
|
|
102
|
+
useObjectUrl,
|
|
103
|
+
useOffsetPagination,
|
|
104
|
+
useOnline,
|
|
105
|
+
usePageLeave,
|
|
106
|
+
useParallax,
|
|
107
|
+
useParentElement,
|
|
108
|
+
usePerformanceObserver,
|
|
109
|
+
usePermission,
|
|
110
|
+
usePointer,
|
|
111
|
+
usePointerLock,
|
|
112
|
+
usePointerSwipe,
|
|
113
|
+
usePreferredColorScheme,
|
|
114
|
+
usePreferredContrast,
|
|
115
|
+
usePreferredDark,
|
|
116
|
+
usePreferredLanguages,
|
|
117
|
+
usePreferredReducedMotion,
|
|
118
|
+
usePrevious,
|
|
119
|
+
useRafFn,
|
|
120
|
+
useRefHistory,
|
|
121
|
+
useResizeObserver,
|
|
122
|
+
useScreenOrientation,
|
|
123
|
+
useScreenSafeArea,
|
|
124
|
+
useScriptTag,
|
|
125
|
+
useScroll,
|
|
126
|
+
useScrollLock,
|
|
127
|
+
useSessionStorage,
|
|
128
|
+
useShare,
|
|
129
|
+
useSorted,
|
|
130
|
+
useSpeechRecognition,
|
|
131
|
+
useSpeechSynthesis,
|
|
132
|
+
useStepper,
|
|
133
|
+
useStorage,
|
|
134
|
+
useStorageAsync,
|
|
135
|
+
useStyleTag,
|
|
136
|
+
useSupported,
|
|
137
|
+
useSwipe,
|
|
138
|
+
useTemplateRefsList,
|
|
139
|
+
useTextDirection,
|
|
140
|
+
useTextSelection,
|
|
141
|
+
useTextareaAutosize,
|
|
142
|
+
useThrottledRefHistory,
|
|
143
|
+
useTimeAgo,
|
|
144
|
+
useTimeoutPoll,
|
|
145
|
+
useTimestamp,
|
|
146
|
+
useTitle,
|
|
147
|
+
useTransition,
|
|
148
|
+
useUrlSearchParams,
|
|
149
|
+
useUserMedia,
|
|
150
|
+
useVModel,
|
|
151
|
+
useVModels,
|
|
152
|
+
useVibrate,
|
|
153
|
+
useVirtualList,
|
|
154
|
+
useWakeLock,
|
|
155
|
+
useWebNotification,
|
|
156
|
+
useWebSocket,
|
|
157
|
+
useWebWorker,
|
|
158
|
+
useWebWorkerFn,
|
|
159
|
+
useWindowFocus,
|
|
160
|
+
useWindowScroll,
|
|
161
|
+
useWindowSize,
|
|
162
|
+
useDateFormat,
|
|
163
|
+
useNow,
|
|
164
|
+
watchArray,
|
|
165
|
+
watchAtMost,
|
|
166
|
+
watchDebounced,
|
|
167
|
+
watchDeep,
|
|
168
|
+
watchIgnorable,
|
|
169
|
+
watchImmediate,
|
|
170
|
+
watchOnce,
|
|
171
|
+
watchPausable,
|
|
172
|
+
watchThrottled,
|
|
173
|
+
watchTriggerable,
|
|
174
|
+
watchWithFilter,
|
|
175
|
+
whenever,
|
|
176
|
+
syncRef,
|
|
177
|
+
syncRefs,
|
|
178
|
+
throttledRef,
|
|
179
|
+
throttledWatch,
|
|
180
|
+
toReactive,
|
|
181
|
+
tryOnBeforeMount,
|
|
182
|
+
tryOnBeforeUnmount,
|
|
183
|
+
tryOnMounted,
|
|
184
|
+
tryOnScopeDispose,
|
|
185
|
+
tryOnUnmounted,
|
|
186
|
+
until,
|
|
187
|
+
isDefined,
|
|
188
|
+
ignorableWatch,
|
|
189
|
+
extendRef,
|
|
190
|
+
eagerComputed,
|
|
191
|
+
debouncedRef,
|
|
192
|
+
debouncedWatch,
|
|
193
|
+
createReactiveFn,
|
|
194
|
+
createSharedComposable,
|
|
195
|
+
createInjectionState,
|
|
196
|
+
createGlobalState,
|
|
197
|
+
createEventHook,
|
|
198
|
+
controlledRef,
|
|
199
|
+
controlledComputed,
|
|
200
|
+
computedEager,
|
|
201
|
+
computedWithControl,
|
|
202
|
+
autoResetRef,
|
|
203
|
+
} from '@vueuse/core'
|
|
204
|
+
|
|
205
|
+
export type {
|
|
206
|
+
// Head,
|
|
207
|
+
HeadClient,
|
|
208
|
+
HeadObject,
|
|
209
|
+
HeadObjectPlain,
|
|
210
|
+
HookBeforeDomUpdate,
|
|
211
|
+
HookEntriesResolved,
|
|
212
|
+
HookTagsResolved,
|
|
213
|
+
LegacyHeadOptions,
|
|
214
|
+
} from '@vueuse/head'
|
|
215
|
+
|
|
216
|
+
export {
|
|
217
|
+
Head,
|
|
218
|
+
HeadVuePlugin,
|
|
219
|
+
createHead,
|
|
220
|
+
renderHeadToString,
|
|
221
|
+
} from '@vueuse/head'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as semver from 'semver'
|
|
@@ -1,29 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export const envVariables = validate.object({
|
|
4
|
-
APP_NAME: validate.string().default('Stacks').optional(),
|
|
5
|
-
APP_ENV: validate.string().default('local').optional(),
|
|
6
|
-
APP_KEY: validate.string(),
|
|
7
|
-
APP_URL: validate.string().url().default('http://localhost:3333'),
|
|
8
|
-
APP_DEBUG: validate.boolean().default(true),
|
|
9
|
-
DB_CONNECTION: validate.string().default('mysql').optional(),
|
|
10
|
-
DB_DATABASE: validate.string().default('stacks').optional(),
|
|
11
|
-
DB_USERNAME: validate.string().default('root').optional(),
|
|
12
|
-
DB_PASSWORD: validate.string().optional(),
|
|
13
|
-
SEARCH_ENGINE_DRIVER: validate.string().optional(),
|
|
14
|
-
MEILISEARCH_HOST: validate.string().optional().default('http://127.0.0.1:7700'),
|
|
15
|
-
MEILISEARCH_KEY: validate.string().optional(),
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
export type StacksEnv = validate.infer<typeof envVariables>
|
|
19
|
-
|
|
20
|
-
export enum Type {
|
|
21
|
-
String = 'String',
|
|
22
|
-
Number = 'Number',
|
|
23
|
-
Boolean = 'Boolean',
|
|
24
|
-
Date = 'Date',
|
|
25
|
-
Object = 'Object',
|
|
26
|
-
Array = 'Array',
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export { validate, z }
|
|
1
|
+
export * from './is'
|
|
2
|
+
export * from './validate'
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getTypeName, toString } from '@stacksjs/utils'
|
|
1
2
|
import validator from 'validator'
|
|
2
3
|
import type { HashAlgorithm } from '@stacksjs/types'
|
|
3
4
|
|
|
@@ -33,18 +34,10 @@ export function isPostalCode(zipCode: string) {
|
|
|
33
34
|
return validator.isPostalCode(zipCode, 'any')
|
|
34
35
|
}
|
|
35
36
|
|
|
36
|
-
export function isDate(date: string) {
|
|
37
|
-
return validator.isDate(date)
|
|
38
|
-
}
|
|
39
|
-
|
|
40
37
|
export function isNumeric(number: string) {
|
|
41
38
|
return validator.isNumeric(number)
|
|
42
39
|
}
|
|
43
40
|
|
|
44
|
-
export function isBoolean(boolean: string) {
|
|
45
|
-
return validator.isBoolean(boolean)
|
|
46
|
-
}
|
|
47
|
-
|
|
48
41
|
export function isHexColor(color: string) {
|
|
49
42
|
return validator.isHexColor(color)
|
|
50
43
|
}
|
|
@@ -180,3 +173,85 @@ export function isISO31661Alpha2(iso31661Alpha2: string) {
|
|
|
180
173
|
export function isISO31661Alpha3(iso31661Alpha3: string) {
|
|
181
174
|
return validator.isISO31661Alpha3(iso31661Alpha3)
|
|
182
175
|
}
|
|
176
|
+
|
|
177
|
+
export function isDef<T = any>(val?: T): val is T {
|
|
178
|
+
return typeof val !== 'undefined'
|
|
179
|
+
}
|
|
180
|
+
export function isBoolean(val: any): val is boolean {
|
|
181
|
+
return typeof val === 'boolean'
|
|
182
|
+
}
|
|
183
|
+
export function isFunction<T extends Function>(val: any): val is T {
|
|
184
|
+
return typeof val === 'function'
|
|
185
|
+
}
|
|
186
|
+
export function isNumber(val: any): val is number {
|
|
187
|
+
return typeof val === 'number'
|
|
188
|
+
}
|
|
189
|
+
export function isString(val: unknown): val is string {
|
|
190
|
+
return typeof val === 'string'
|
|
191
|
+
}
|
|
192
|
+
export function isObject(val: any): val is object {
|
|
193
|
+
return toString(val) === '[object Object]'
|
|
194
|
+
}
|
|
195
|
+
export function isWindow(val: any): boolean {
|
|
196
|
+
return typeof window !== 'undefined' && toString(val) === '[object Window]'
|
|
197
|
+
}
|
|
198
|
+
export const isBrowser = typeof window !== 'undefined'
|
|
199
|
+
export const isServer = typeof document === 'undefined' // https://remix.run/docs/en/v1/pages/gotchas#typeof-window-checks
|
|
200
|
+
export function isMap(val: any): val is Map<any, any> {
|
|
201
|
+
return toString(val) === '[object Map]'
|
|
202
|
+
}
|
|
203
|
+
export function isSet(val: any): val is Set<any> {
|
|
204
|
+
return toString(val) === '[object Set]'
|
|
205
|
+
}
|
|
206
|
+
export function isPromise<T = any>(val: any): val is Promise<T> {
|
|
207
|
+
return toString(val) === '[object Promise]'
|
|
208
|
+
}
|
|
209
|
+
export function isUndefined(v: any) {
|
|
210
|
+
return getTypeName(v) === 'undefined'
|
|
211
|
+
}
|
|
212
|
+
export function isNull(v: any) {
|
|
213
|
+
return getTypeName(v) === 'null'
|
|
214
|
+
}
|
|
215
|
+
export function isSymbol(v: any) {
|
|
216
|
+
return getTypeName(v) === 'symbol'
|
|
217
|
+
}
|
|
218
|
+
export function isDate(v: any) {
|
|
219
|
+
return getTypeName(v) === 'date'
|
|
220
|
+
}
|
|
221
|
+
export function isRegExp(v: any) {
|
|
222
|
+
return getTypeName(v) === 'regexp'
|
|
223
|
+
}
|
|
224
|
+
export function isArray(v: any) {
|
|
225
|
+
return getTypeName(v) === 'array'
|
|
226
|
+
}
|
|
227
|
+
export function isPrimitive(v: any) {
|
|
228
|
+
const type = getTypeName(v)
|
|
229
|
+
return type === 'null' || type === 'undefined' || type === 'string' || type === 'number' || type === 'boolean' || type === 'symbol'
|
|
230
|
+
}
|
|
231
|
+
export function isInteger(v: any) {
|
|
232
|
+
return isNumber(v) && Number.isInteger(v)
|
|
233
|
+
}
|
|
234
|
+
export function isFloat(v: any) {
|
|
235
|
+
return isNumber(v) && !Number.isInteger(v)
|
|
236
|
+
}
|
|
237
|
+
export function isPositive(v: any) {
|
|
238
|
+
return isNumber(v) && v > 0
|
|
239
|
+
}
|
|
240
|
+
export function isNegative(v: any) {
|
|
241
|
+
return isNumber(v) && v < 0
|
|
242
|
+
}
|
|
243
|
+
export function isEven(v: any) {
|
|
244
|
+
return isNumber(v) && v % 2 === 0
|
|
245
|
+
}
|
|
246
|
+
export function isOdd(v: any) {
|
|
247
|
+
return isNumber(v) && v % 2 !== 0
|
|
248
|
+
}
|
|
249
|
+
export function isEvenOrOdd(v: any) {
|
|
250
|
+
return isNumber(v) && (v % 2 === 0 ? 'even' : 'odd')
|
|
251
|
+
}
|
|
252
|
+
export function isPositiveOrNegative(v: any) {
|
|
253
|
+
return isNumber(v) && (v > 0 ? 'positive' : 'negative')
|
|
254
|
+
}
|
|
255
|
+
export function isIntegerOrFloat(v: any) {
|
|
256
|
+
return isNumber(v) && (Number.isInteger(v) ? 'integer' : 'float')
|
|
257
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z as validate, z } from 'zod'
|
|
2
|
+
|
|
3
|
+
export const envVariables = validate.object({
|
|
4
|
+
APP_NAME: validate.string().default('Stacks').optional(),
|
|
5
|
+
APP_ENV: validate.string().default('local').optional(),
|
|
6
|
+
APP_KEY: validate.string(),
|
|
7
|
+
APP_URL: validate.string().url().default('http://localhost:3333'),
|
|
8
|
+
APP_DEBUG: validate.boolean().default(true),
|
|
9
|
+
DB_CONNECTION: validate.string().default('mysql').optional(),
|
|
10
|
+
DB_DATABASE: validate.string().default('stacks').optional(),
|
|
11
|
+
DB_USERNAME: validate.string().default('root').optional(),
|
|
12
|
+
DB_PASSWORD: validate.string().optional(),
|
|
13
|
+
SEARCH_ENGINE_DRIVER: validate.string().optional(),
|
|
14
|
+
MEILISEARCH_HOST: validate.string().optional().default('http://127.0.0.1:7700'),
|
|
15
|
+
MEILISEARCH_KEY: validate.string().optional(),
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
export type StacksEnv = validate.infer<typeof envVariables>
|
|
19
|
+
|
|
20
|
+
export enum Type {
|
|
21
|
+
String = 'String',
|
|
22
|
+
Number = 'Number',
|
|
23
|
+
Boolean = 'Boolean',
|
|
24
|
+
Date = 'Date',
|
|
25
|
+
Object = 'Object',
|
|
26
|
+
Array = 'Array',
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { validate, z }
|
|
@@ -6,12 +6,12 @@ case `uname` in
|
|
|
6
6
|
esac
|
|
7
7
|
|
|
8
8
|
if [ -z "$NODE_PATH" ]; then
|
|
9
|
-
export NODE_PATH="/home/runner/work/stacks/stacks/node_modules/.pnpm/rimraf@5.0.
|
|
9
|
+
export NODE_PATH="/home/runner/work/stacks/stacks/node_modules/.pnpm/rimraf@5.0.1/node_modules/rimraf/dist/cjs/src/node_modules:/home/runner/work/stacks/stacks/node_modules/.pnpm/rimraf@5.0.1/node_modules/rimraf/dist/cjs/node_modules:/home/runner/work/stacks/stacks/node_modules/.pnpm/rimraf@5.0.1/node_modules/rimraf/dist/node_modules:/home/runner/work/stacks/stacks/node_modules/.pnpm/rimraf@5.0.1/node_modules/rimraf/node_modules:/home/runner/work/stacks/stacks/node_modules/.pnpm/rimraf@5.0.1/node_modules:/home/runner/work/stacks/stacks/node_modules/.pnpm/node_modules"
|
|
10
10
|
else
|
|
11
|
-
export NODE_PATH="/home/runner/work/stacks/stacks/node_modules/.pnpm/rimraf@5.0.
|
|
11
|
+
export NODE_PATH="/home/runner/work/stacks/stacks/node_modules/.pnpm/rimraf@5.0.1/node_modules/rimraf/dist/cjs/src/node_modules:/home/runner/work/stacks/stacks/node_modules/.pnpm/rimraf@5.0.1/node_modules/rimraf/dist/cjs/node_modules:/home/runner/work/stacks/stacks/node_modules/.pnpm/rimraf@5.0.1/node_modules/rimraf/dist/node_modules:/home/runner/work/stacks/stacks/node_modules/.pnpm/rimraf@5.0.1/node_modules/rimraf/node_modules:/home/runner/work/stacks/stacks/node_modules/.pnpm/rimraf@5.0.1/node_modules:/home/runner/work/stacks/stacks/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
12
12
|
fi
|
|
13
13
|
if [ -x "$basedir/node" ]; then
|
|
14
|
-
exec "$basedir/node" "$basedir/../../../../node_modules/.pnpm/rimraf@5.0.
|
|
14
|
+
exec "$basedir/node" "$basedir/../../../../node_modules/.pnpm/rimraf@5.0.1/node_modules/rimraf/dist/cjs/src/bin.js" "$@"
|
|
15
15
|
else
|
|
16
|
-
exec node "$basedir/../../../../node_modules/.pnpm/rimraf@5.0.
|
|
16
|
+
exec node "$basedir/../../../../node_modules/.pnpm/rimraf@5.0.1/node_modules/rimraf/dist/cjs/src/bin.js" "$@"
|
|
17
17
|
fi
|
|
@@ -6,12 +6,12 @@ case `uname` in
|
|
|
6
6
|
esac
|
|
7
7
|
|
|
8
8
|
if [ -z "$NODE_PATH" ]; then
|
|
9
|
-
export NODE_PATH="/home/runner/work/stacks/stacks/node_modules/.pnpm/vitepress@1.0.0-alpha.
|
|
9
|
+
export NODE_PATH="/home/runner/work/stacks/stacks/node_modules/.pnpm/vitepress@1.0.0-alpha.76_@algolia+client-search@4.17.0_@types+node@18.16.13/node_modules/vitepress/bin/node_modules:/home/runner/work/stacks/stacks/node_modules/.pnpm/vitepress@1.0.0-alpha.76_@algolia+client-search@4.17.0_@types+node@18.16.13/node_modules/vitepress/node_modules:/home/runner/work/stacks/stacks/node_modules/.pnpm/vitepress@1.0.0-alpha.76_@algolia+client-search@4.17.0_@types+node@18.16.13/node_modules:/home/runner/work/stacks/stacks/node_modules/.pnpm/node_modules"
|
|
10
10
|
else
|
|
11
|
-
export NODE_PATH="/home/runner/work/stacks/stacks/node_modules/.pnpm/vitepress@1.0.0-alpha.
|
|
11
|
+
export NODE_PATH="/home/runner/work/stacks/stacks/node_modules/.pnpm/vitepress@1.0.0-alpha.76_@algolia+client-search@4.17.0_@types+node@18.16.13/node_modules/vitepress/bin/node_modules:/home/runner/work/stacks/stacks/node_modules/.pnpm/vitepress@1.0.0-alpha.76_@algolia+client-search@4.17.0_@types+node@18.16.13/node_modules/vitepress/node_modules:/home/runner/work/stacks/stacks/node_modules/.pnpm/vitepress@1.0.0-alpha.76_@algolia+client-search@4.17.0_@types+node@18.16.13/node_modules:/home/runner/work/stacks/stacks/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
12
12
|
fi
|
|
13
13
|
if [ -x "$basedir/node" ]; then
|
|
14
|
-
exec "$basedir/node" "$basedir/../../../../node_modules/.pnpm/vitepress@1.0.0-alpha.
|
|
14
|
+
exec "$basedir/node" "$basedir/../../../../node_modules/.pnpm/vitepress@1.0.0-alpha.76_@algolia+client-search@4.17.0_@types+node@18.16.13/node_modules/vitepress/bin/vitepress.js" "$@"
|
|
15
15
|
else
|
|
16
|
-
exec node "$basedir/../../../../node_modules/.pnpm/vitepress@1.0.0-alpha.
|
|
16
|
+
exec node "$basedir/../../../../node_modules/.pnpm/vitepress@1.0.0-alpha.76_@algolia+client-search@4.17.0_@types+node@18.16.13/node_modules/vitepress/bin/vitepress.js" "$@"
|
|
17
17
|
fi
|
package/docs/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stacks",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.52.
|
|
4
|
+
"version": "0.52.2",
|
|
5
5
|
"packageManager": "pnpm@8.5.1",
|
|
6
6
|
"description": "The Stacks framework.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
@@ -62,51 +62,98 @@
|
|
|
62
62
|
],
|
|
63
63
|
"web-types": "./web-types.json",
|
|
64
64
|
"peerDependencies": {
|
|
65
|
-
"@stacksjs/actions": "0.52.
|
|
66
|
-
"@stacksjs/ai": "0.52.
|
|
67
|
-
"@stacksjs/alias": "0.52.
|
|
68
|
-
"@stacksjs/arrays": "0.52.
|
|
69
|
-
"@stacksjs/auth": "0.52.
|
|
70
|
-
"@stacksjs/buddy": "0.52.
|
|
71
|
-
"@stacksjs/build": "0.52.
|
|
72
|
-
"@stacksjs/cache": "0.52.
|
|
73
|
-
"@stacksjs/cli": "0.52.
|
|
74
|
-
"@stacksjs/cloud": "0.52.
|
|
75
|
-
"@stacksjs/collections": "0.52.
|
|
76
|
-
"@stacksjs/config": "0.52.
|
|
77
|
-
"@stacksjs/database": "0.52.
|
|
78
|
-
"@stacksjs/desktop": "0.52.
|
|
79
|
-
"@stacksjs/development": "0.52.
|
|
80
|
-
"@stacksjs/docs": "0.52.
|
|
81
|
-
"@stacksjs/domains": "0.52.
|
|
82
|
-
"@stacksjs/email": "0.52.
|
|
83
|
-
"@stacksjs/error-handling": "0.52.
|
|
84
|
-
"@stacksjs/events": "0.52.
|
|
85
|
-
"@stacksjs/faker": "0.52.
|
|
86
|
-
"@stacksjs/git": "0.52.
|
|
87
|
-
"@stacksjs/health": "0.52.
|
|
88
|
-
"@stacksjs/lint": "0.52.
|
|
89
|
-
"@stacksjs/logging": "0.52.
|
|
90
|
-
"@stacksjs/modules": "0.52.
|
|
91
|
-
"@stacksjs/notifications": "0.52.
|
|
92
|
-
"@stacksjs/objects": "0.52.
|
|
93
|
-
"@stacksjs/orm": "0.52.
|
|
94
|
-
"@stacksjs/pages": "0.52.
|
|
95
|
-
"@stacksjs/path": "0.52.
|
|
96
|
-
"@stacksjs/payments": "0.52.
|
|
97
|
-
"@stacksjs/realtime": "0.52.
|
|
98
|
-
"@stacksjs/router": "0.52.
|
|
99
|
-
"@stacksjs/search-engine": "0.52.
|
|
100
|
-
"@stacksjs/security": "0.52.
|
|
101
|
-
"@stacksjs/server": "0.52.
|
|
102
|
-
"@stacksjs/signals": "0.52.
|
|
103
|
-
"@stacksjs/storage": "0.52.
|
|
104
|
-
"@stacksjs/strings": "0.52.
|
|
105
|
-
"@stacksjs/testing": "0.52.
|
|
106
|
-
"@stacksjs/types": "0.52.
|
|
107
|
-
"@stacksjs/ui": "0.52.
|
|
108
|
-
"@stacksjs/utils": "0.52.
|
|
109
|
-
"@stacksjs/validation": "0.52.
|
|
65
|
+
"@stacksjs/actions": "0.52.2",
|
|
66
|
+
"@stacksjs/ai": "0.52.2",
|
|
67
|
+
"@stacksjs/alias": "0.52.2",
|
|
68
|
+
"@stacksjs/arrays": "0.52.2",
|
|
69
|
+
"@stacksjs/auth": "0.52.2",
|
|
70
|
+
"@stacksjs/buddy": "0.52.2",
|
|
71
|
+
"@stacksjs/build": "0.52.2",
|
|
72
|
+
"@stacksjs/cache": "0.52.2",
|
|
73
|
+
"@stacksjs/cli": "0.52.2",
|
|
74
|
+
"@stacksjs/cloud": "0.52.2",
|
|
75
|
+
"@stacksjs/collections": "0.52.2",
|
|
76
|
+
"@stacksjs/config": "0.52.2",
|
|
77
|
+
"@stacksjs/database": "0.52.2",
|
|
78
|
+
"@stacksjs/desktop": "0.52.2",
|
|
79
|
+
"@stacksjs/development": "0.52.2",
|
|
80
|
+
"@stacksjs/docs": "0.52.2",
|
|
81
|
+
"@stacksjs/domains": "0.52.2",
|
|
82
|
+
"@stacksjs/email": "0.52.2",
|
|
83
|
+
"@stacksjs/error-handling": "0.52.2",
|
|
84
|
+
"@stacksjs/events": "0.52.2",
|
|
85
|
+
"@stacksjs/faker": "0.52.2",
|
|
86
|
+
"@stacksjs/git": "0.52.2",
|
|
87
|
+
"@stacksjs/health": "0.52.2",
|
|
88
|
+
"@stacksjs/lint": "0.52.2",
|
|
89
|
+
"@stacksjs/logging": "0.52.2",
|
|
90
|
+
"@stacksjs/modules": "0.52.2",
|
|
91
|
+
"@stacksjs/notifications": "0.52.2",
|
|
92
|
+
"@stacksjs/objects": "0.52.2",
|
|
93
|
+
"@stacksjs/orm": "0.52.2",
|
|
94
|
+
"@stacksjs/pages": "0.52.2",
|
|
95
|
+
"@stacksjs/path": "0.52.2",
|
|
96
|
+
"@stacksjs/payments": "0.52.2",
|
|
97
|
+
"@stacksjs/realtime": "0.52.2",
|
|
98
|
+
"@stacksjs/router": "0.52.2",
|
|
99
|
+
"@stacksjs/search-engine": "0.52.2",
|
|
100
|
+
"@stacksjs/security": "0.52.2",
|
|
101
|
+
"@stacksjs/server": "0.52.2",
|
|
102
|
+
"@stacksjs/signals": "0.52.2",
|
|
103
|
+
"@stacksjs/storage": "0.52.2",
|
|
104
|
+
"@stacksjs/strings": "0.52.2",
|
|
105
|
+
"@stacksjs/testing": "0.52.2",
|
|
106
|
+
"@stacksjs/types": "0.52.2",
|
|
107
|
+
"@stacksjs/ui": "0.52.2",
|
|
108
|
+
"@stacksjs/utils": "0.52.2",
|
|
109
|
+
"@stacksjs/validation": "0.52.2"
|
|
110
|
+
},
|
|
111
|
+
"dependencies": {
|
|
112
|
+
"@stacksjs/actions": "0.52.2",
|
|
113
|
+
"@stacksjs/ai": "0.52.2",
|
|
114
|
+
"@stacksjs/alias": "0.52.2",
|
|
115
|
+
"@stacksjs/arrays": "0.52.2",
|
|
116
|
+
"@stacksjs/auth": "0.52.2",
|
|
117
|
+
"@stacksjs/buddy": "0.52.2",
|
|
118
|
+
"@stacksjs/build": "0.52.2",
|
|
119
|
+
"@stacksjs/cache": "0.52.2",
|
|
120
|
+
"@stacksjs/cli": "0.52.2",
|
|
121
|
+
"@stacksjs/cloud": "0.52.2",
|
|
122
|
+
"@stacksjs/collections": "0.52.2",
|
|
123
|
+
"@stacksjs/config": "0.52.2",
|
|
124
|
+
"@stacksjs/database": "0.52.2",
|
|
125
|
+
"@stacksjs/desktop": "0.52.2",
|
|
126
|
+
"@stacksjs/development": "0.52.2",
|
|
127
|
+
"@stacksjs/docs": "0.52.2",
|
|
128
|
+
"@stacksjs/domains": "0.52.2",
|
|
129
|
+
"@stacksjs/email": "0.52.2",
|
|
130
|
+
"@stacksjs/error-handling": "0.52.2",
|
|
131
|
+
"@stacksjs/events": "0.52.2",
|
|
132
|
+
"@stacksjs/faker": "0.52.2",
|
|
133
|
+
"@stacksjs/git": "0.52.2",
|
|
134
|
+
"@stacksjs/health": "0.52.2",
|
|
135
|
+
"@stacksjs/lint": "0.52.2",
|
|
136
|
+
"@stacksjs/logging": "0.52.2",
|
|
137
|
+
"@stacksjs/modules": "0.52.2",
|
|
138
|
+
"@stacksjs/notifications": "0.52.2",
|
|
139
|
+
"@stacksjs/objects": "0.52.2",
|
|
140
|
+
"@stacksjs/orm": "0.52.2",
|
|
141
|
+
"@stacksjs/pages": "0.52.2",
|
|
142
|
+
"@stacksjs/path": "0.52.2",
|
|
143
|
+
"@stacksjs/payments": "0.52.2",
|
|
144
|
+
"@stacksjs/realtime": "0.52.2",
|
|
145
|
+
"@stacksjs/router": "0.52.2",
|
|
146
|
+
"@stacksjs/search-engine": "0.52.2",
|
|
147
|
+
"@stacksjs/security": "0.52.2",
|
|
148
|
+
"@stacksjs/server": "0.52.2",
|
|
149
|
+
"@stacksjs/signals": "0.52.2",
|
|
150
|
+
"@stacksjs/storage": "0.52.2",
|
|
151
|
+
"@stacksjs/strings": "0.52.2",
|
|
152
|
+
"@stacksjs/testing": "0.52.2",
|
|
153
|
+
"@stacksjs/types": "0.52.2",
|
|
154
|
+
"@stacksjs/ui": "0.52.2",
|
|
155
|
+
"@stacksjs/utils": "0.52.2",
|
|
156
|
+
"@stacksjs/validation": "0.52.2"
|
|
110
157
|
},
|
|
111
158
|
"scripts": {
|
|
112
159
|
"buddy": "tsx ./core/buddy/src/cli.ts",
|
package/vitest.config.ts
CHANGED
|
@@ -1,23 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { defineWorkspace } from 'vitest/config'
|
|
2
|
+
import { alias } from '@stacksjs/alias'
|
|
3
|
+
import { frameworkPath } from '@stacksjs/path'
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
root: '..',
|
|
5
|
+
// todo: https://github.com/vitest-dev/vscode/issues/151
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
export default defineWorkspace([
|
|
8
|
+
frameworkPath('core/**'),
|
|
9
|
+
frameworkPath('stacks/**'),
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
{
|
|
12
|
+
// root: projectPath(),
|
|
13
|
+
|
|
14
|
+
resolve: {
|
|
15
|
+
alias,
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
optimizeDeps: {
|
|
19
|
+
entries: [],
|
|
20
|
+
},
|
|
15
21
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
test: {
|
|
23
|
+
globals: true,
|
|
24
|
+
exclude: ['**/src/**', '**/node_modules/**', '**/samples/**', 'out/**'],
|
|
25
|
+
// coverage: {
|
|
26
|
+
// provider: 'istanbul',
|
|
27
|
+
// reportsDirectory: projectPath('./tests/unit/coverage'),
|
|
28
|
+
// },
|
|
21
29
|
},
|
|
22
30
|
},
|
|
23
|
-
|
|
31
|
+
])
|