@stacksjs/utils 0.52.10 → 0.53.1
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/dist/guards.d.ts +1 -0
- package/dist/guards.mjs +3 -0
- package/dist/helpers.d.ts +1 -0
- package/dist/helpers.mjs +21 -7
- package/dist/vendors.d.ts +1 -1
- package/dist/vendors.mjs +1 -0
- package/package.json +19 -19
package/dist/guards.d.ts
CHANGED
package/dist/guards.mjs
CHANGED
package/dist/helpers.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { CliOptions, CommandResult, Manifest, NpmScript } from '@stacksjs/types';
|
|
2
2
|
import detectIndent from 'detect-indent';
|
|
3
3
|
export declare function isProjectCreated(): Promise<boolean>;
|
|
4
|
+
export declare function installIfVersionMismatch(): Promise<void>;
|
|
4
5
|
export declare function frameworkVersion(): Promise<string>;
|
|
5
6
|
export declare function isAppKeySet(): Promise<boolean>;
|
|
6
7
|
/**
|
package/dist/helpers.mjs
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import detectIndent from "detect-indent";
|
|
2
2
|
import { frameworkPath, projectPath } from "@stacksjs/path";
|
|
3
3
|
import { parse } from "yaml";
|
|
4
|
-
import { log, runCommand, spawn } from "@stacksjs/cli";
|
|
5
|
-
import storage from "@stacksjs/storage";
|
|
4
|
+
import { execSync, log, runCommand, spawn } from "@stacksjs/cli";
|
|
6
5
|
import { app, ui } from "@stacksjs/config";
|
|
6
|
+
import { storage } from "@stacksjs/storage";
|
|
7
|
+
import { semver } from "./versions.mjs";
|
|
7
8
|
export async function isProjectCreated() {
|
|
8
9
|
if (storage.isFile(".env"))
|
|
9
10
|
return await isAppKeySet();
|
|
@@ -11,17 +12,30 @@ export async function isProjectCreated() {
|
|
|
11
12
|
await spawn("cp .env.example .env", { stdio: "inherit", cwd: projectPath() });
|
|
12
13
|
return await isAppKeySet();
|
|
13
14
|
}
|
|
15
|
+
export async function installIfVersionMismatch() {
|
|
16
|
+
const dependenciesYaml = storage.fs.readFileSync(projectPath("tea.yaml"), "utf8");
|
|
17
|
+
const dependencies = parseYaml(dependenciesYaml).dependencies;
|
|
18
|
+
const requiredNodeVersion = dependencies["nodejs.org"];
|
|
19
|
+
const requiredPnpmVersion = dependencies["pnpm.io"];
|
|
20
|
+
const installedNodeVersion = process.version;
|
|
21
|
+
const installedPnpmVersion = execSync("pnpm -v").trim();
|
|
22
|
+
if (!semver.satisfies(installedNodeVersion, requiredNodeVersion)) {
|
|
23
|
+
log.error(`Installed Node.js version (${installedNodeVersion}) does not satisfy required version (${requiredNodeVersion}). One moment...`);
|
|
24
|
+
await runCommand(`tea +nodejs.org${requiredNodeVersion} >/dev/null 2>&1`);
|
|
25
|
+
}
|
|
26
|
+
if (!semver.satisfies(installedPnpmVersion, requiredPnpmVersion)) {
|
|
27
|
+
log.error(`Installed pnpm version (${installedPnpmVersion}) does not satisfy required version (${requiredPnpmVersion}). One moment...`);
|
|
28
|
+
await runCommand(`tea +pnpm.io${requiredPnpmVersion} >/dev/null 2>&1`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
14
31
|
export async function frameworkVersion() {
|
|
15
|
-
|
|
16
|
-
return packageJson.version;
|
|
32
|
+
return (await storage.readPackageJson(frameworkPath("package.json"))).version;
|
|
17
33
|
}
|
|
18
34
|
export async function isAppKeySet() {
|
|
19
35
|
const env = await storage.readTextFile(".env", projectPath());
|
|
20
36
|
const lines = env.data.split("\n");
|
|
21
37
|
const appKey = lines.find((line) => line.startsWith("APP_KEY="));
|
|
22
|
-
|
|
23
|
-
return true;
|
|
24
|
-
return false;
|
|
38
|
+
return !!(appKey && appKey.length > 16);
|
|
25
39
|
}
|
|
26
40
|
export function determineResetPreset(preset) {
|
|
27
41
|
if (ui.reset)
|
package/dist/vendors.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { asyncComputed, breakpointsAntDesign, breakpointsBootstrapV5, breakpointsMasterCss, breakpointsQuasar, breakpointsSematic, breakpointsTailwind, breakpointsVuetify, cloneFnJSON, computedAsync, computedInject, createFetch, createReusableTemplate, createTemplatePromise, createUnrefFn, customStorageEventName, defaultDocument, defaultLocation, defaultNavigator, defaultWindow, executeTransition, formatTimeAgo, getSSRHandler, mapGamepadToXbox360Controller, onClickOutside, onKeyDown, onKeyPressed, onKeyStroke, onKeyUp, onLongPress, onStartTyping, setSSRHandler, templateRef, unrefElement, useActiveElement, useAnimate, useAsyncQueue, useAsyncState, useBase64, useBattery, useBluetooth, useBreakpoints, useBroadcastChannel, useBrowserLocation, useCached, useClipboard, useCloned, useColorMode, useConfirmDialog, useCssVar, useCurrentElement, useCycleList, useDark, useDebouncedRefHistory, useDeviceMotion, useDeviceOrientation, useDevicePixelRatio, useDevicesList, useDisplayMedia, useDocumentVisibility, useDraggable, useDropZone, useElementBounding, useElementByPoint, useElementHover, useElementSize, useElementVisibility, useEventBus, useEventListener, useEventSource, useEyeDropper, useFavicon, useFetch, useFileDialog, useFileSystemAccess, useFocus, useFocusWithin, useFps, useFullscreen, useGamepad, useGeolocation, useIdle, useImage, useInfiniteScroll, useIntersectionObserver, useKeyModifier, useLocalStorage, useMagicKeys, useManualRefHistory, useMediaControls, useMediaQuery, useMemoize, useMemory, useMounted, useMouse, useMouseInElement, useMousePressed, useMutationObserver, useNavigatorLanguage, useNetwork, useObjectUrl, useOffsetPagination, useOnline, usePageLeave, useParallax, useParentElement, usePerformanceObserver, usePermission, usePointer, usePointerLock, usePointerSwipe, usePreferredColorScheme, usePreferredContrast, usePreferredDark, usePreferredLanguages, usePreferredReducedMotion, usePrevious, useRafFn, useRefHistory, useResizeObserver, useScreenOrientation, useScreenSafeArea, useScriptTag, useScroll, useScrollLock, useSessionStorage, useShare, useSorted, useSpeechRecognition, useSpeechSynthesis, useStepper, useStorage, useStorageAsync, useStyleTag, useSupported, useSwipe, useTemplateRefsList, useTextDirection, useTextSelection, useTextareaAutosize, useThrottledRefHistory, useTimeAgo, useTimeoutPoll, useTimestamp, useTitle, useTransition, useUrlSearchParams, useUserMedia, useVModel, useVModels, useVibrate, useVirtualList, useWakeLock, useWebNotification, useWebSocket, useWebWorker, useWebWorkerFn, useWindowFocus, useWindowScroll, useWindowSize, useDateFormat, useNow, watchArray, watchAtMost, watchDebounced, watchDeep, watchIgnorable, watchImmediate, watchOnce, watchPausable, watchThrottled, watchTriggerable, watchWithFilter, whenever, syncRef, syncRefs, throttledRef, throttledWatch, toReactive, tryOnBeforeMount, tryOnBeforeUnmount, tryOnMounted, tryOnScopeDispose, tryOnUnmounted, until, isDefined, ignorableWatch, extendRef, eagerComputed, debouncedRef, debouncedWatch, createReactiveFn, createSharedComposable, createInjectionState, createGlobalState, createEventHook, controlledRef, controlledComputed, computedEager, computedWithControl, autoResetRef, } from '@vueuse/core';
|
|
1
|
+
export { asyncComputed, breakpointsAntDesign, breakpointsBootstrapV5, breakpointsMasterCss, breakpointsQuasar, breakpointsSematic, breakpointsTailwind, breakpointsVuetify, cloneFnJSON, computedAsync, computedInject, createFetch, createReusableTemplate, createTemplatePromise, createUnrefFn, customStorageEventName, defaultDocument, defaultLocation, defaultNavigator, defaultWindow, executeTransition, formatTimeAgo, getSSRHandler, mapGamepadToXbox360Controller, onClickOutside, onKeyDown, onKeyPressed, onKeyStroke, onKeyUp, onLongPress, onStartTyping, setSSRHandler, templateRef, unrefElement, useActiveElement, useAnimate, useAsyncQueue, useAsyncState, useBase64, useBattery, useBluetooth, useBreakpoints, useBroadcastChannel, useBrowserLocation, useCached, useClipboard, useCloned, useColorMode, useConfirmDialog, useCssVar, useCurrentElement, useCycleList, useDark, useDebouncedRefHistory, useDeviceMotion, useDeviceOrientation, useDevicePixelRatio, useDevicesList, useDisplayMedia, useDocumentVisibility, useDraggable, useDropZone, useElementBounding, useElementByPoint, useElementHover, useElementSize, useElementVisibility, useEventBus, useEventListener, useEventSource, useEyeDropper, useFavicon, useFetch, useFileDialog, useFileSystemAccess, useFocus, useFocusWithin, useFps, useFullscreen, useGamepad, useGeolocation, useIdle, useImage, useInfiniteScroll, useIntersectionObserver, useKeyModifier, useLocalStorage, useMagicKeys, useManualRefHistory, useMediaControls, useMediaQuery, useMemoize, useMemory, useMounted, useMouse, useMouseInElement, useMousePressed, useMutationObserver, useNavigatorLanguage, useNetwork, useObjectUrl, useOffsetPagination, useOnline, usePageLeave, useParallax, useParentElement, usePerformanceObserver, usePermission, usePointer, usePointerLock, usePointerSwipe, usePreferredColorScheme, usePreferredContrast, usePreferredDark, usePreferredLanguages, usePreferredReducedMotion, usePrevious, useRafFn, useRefHistory, useResizeObserver, useScreenOrientation, useScreenSafeArea, useScriptTag, useScroll, useScrollLock, useSessionStorage, useShare, useSorted, useSpeechRecognition, useSpeechSynthesis, useStepper, useStorage, useStorageAsync, useStyleTag, useSupported, useSwipe, useTemplateRefsList, useTextDirection, useTextSelection, useTextareaAutosize, useThrottledRefHistory, useTimeAgo, useTimeoutPoll, useTimestamp, useTitle, useTransition, useToggle, useUrlSearchParams, useUserMedia, useVModel, useVModels, useVibrate, useVirtualList, useWakeLock, useWebNotification, useWebSocket, useWebWorker, useWebWorkerFn, useWindowFocus, useWindowScroll, useWindowSize, useDateFormat, useNow, watchArray, watchAtMost, watchDebounced, watchDeep, watchIgnorable, watchImmediate, watchOnce, watchPausable, watchThrottled, watchTriggerable, watchWithFilter, whenever, syncRef, syncRefs, throttledRef, throttledWatch, toReactive, tryOnBeforeMount, tryOnBeforeUnmount, tryOnMounted, tryOnScopeDispose, tryOnUnmounted, until, isDefined, ignorableWatch, extendRef, eagerComputed, debouncedRef, debouncedWatch, createReactiveFn, createSharedComposable, createInjectionState, createGlobalState, createEventHook, controlledRef, controlledComputed, computedEager, computedWithControl, autoResetRef, } from '@vueuse/core';
|
|
2
2
|
export type { HeadClient, HeadObject, HeadObjectPlain, HookBeforeDomUpdate, HookEntriesResolved, HookTagsResolved, LegacyHeadOptions, } from '@vueuse/head';
|
|
3
3
|
export { Head, HeadVuePlugin, createHead, renderHeadToString, } from '@vueuse/head';
|
package/dist/vendors.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/utils",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.53.1",
|
|
5
5
|
"packageManager": "pnpm@8.5.1",
|
|
6
6
|
"description": "The Stacks helper functions.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
@@ -56,15 +56,15 @@
|
|
|
56
56
|
"p-limit": "^4.0.0",
|
|
57
57
|
"rimraf": "^5.0.1",
|
|
58
58
|
"semver": "^7.5.1",
|
|
59
|
-
"yaml": "^2.
|
|
60
|
-
"@stacksjs/arrays": "0.
|
|
61
|
-
"@stacksjs/cli": "0.
|
|
62
|
-
"@stacksjs/config": "0.
|
|
63
|
-
"@stacksjs/development": "0.
|
|
64
|
-
"@stacksjs/lint": "0.
|
|
65
|
-
"@stacksjs/path": "0.
|
|
66
|
-
"@stacksjs/storage": "0.
|
|
67
|
-
"@stacksjs/types": "0.
|
|
59
|
+
"yaml": "^2.3.0",
|
|
60
|
+
"@stacksjs/arrays": "0.53.1",
|
|
61
|
+
"@stacksjs/cli": "0.53.1",
|
|
62
|
+
"@stacksjs/config": "0.53.1",
|
|
63
|
+
"@stacksjs/development": "0.53.1",
|
|
64
|
+
"@stacksjs/lint": "0.53.1",
|
|
65
|
+
"@stacksjs/path": "0.53.1",
|
|
66
|
+
"@stacksjs/storage": "0.53.1",
|
|
67
|
+
"@stacksjs/types": "0.53.1"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
70
|
"@vueuse/core": "^10.1.2",
|
|
@@ -81,17 +81,17 @@
|
|
|
81
81
|
"perfect-debounce": "^1.0.0",
|
|
82
82
|
"rimraf": "^5.0.1",
|
|
83
83
|
"semver": "^7.5.1",
|
|
84
|
-
"yaml": "^2.
|
|
85
|
-
"@stacksjs/arrays": "0.
|
|
86
|
-
"@stacksjs/cli": "0.
|
|
87
|
-
"@stacksjs/config": "0.
|
|
88
|
-
"@stacksjs/lint": "0.
|
|
89
|
-
"@stacksjs/path": "0.
|
|
90
|
-
"@stacksjs/storage": "0.
|
|
91
|
-
"@stacksjs/types": "0.
|
|
84
|
+
"yaml": "^2.3.0",
|
|
85
|
+
"@stacksjs/arrays": "0.53.1",
|
|
86
|
+
"@stacksjs/cli": "0.53.1",
|
|
87
|
+
"@stacksjs/config": "0.53.1",
|
|
88
|
+
"@stacksjs/lint": "0.53.1",
|
|
89
|
+
"@stacksjs/path": "0.53.1",
|
|
90
|
+
"@stacksjs/storage": "0.53.1",
|
|
91
|
+
"@stacksjs/types": "0.53.1"
|
|
92
92
|
},
|
|
93
93
|
"devDependencies": {
|
|
94
|
-
"@stacksjs/development": "0.
|
|
94
|
+
"@stacksjs/development": "0.53.1"
|
|
95
95
|
},
|
|
96
96
|
"scripts": {
|
|
97
97
|
"build": "unbuild",
|