fix: check CI on local build and start (#182)

This commit is contained in:
Joaquín Sánchez 2022-11-27 16:04:04 +01:00 committed by GitHub
parent 3cbdf9eab5
commit 509ff9e016
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 2 deletions

View file

@ -59,6 +59,7 @@
"prettier": "^2.8.0", "prettier": "^2.8.0",
"rollup-plugin-node-polyfills": "^0.2.1", "rollup-plugin-node-polyfills": "^0.2.1",
"shiki": "^0.11.1", "shiki": "^0.11.1",
"std-env": "^3.3.1",
"theme-vitesse": "^0.6.0", "theme-vitesse": "^0.6.0",
"tippy.js": "^6.3.7", "tippy.js": "^6.3.7",
"typescript": "^4.9.3", "typescript": "^4.9.3",

View file

@ -44,6 +44,7 @@ specifiers:
prettier: ^2.8.0 prettier: ^2.8.0
rollup-plugin-node-polyfills: ^0.2.1 rollup-plugin-node-polyfills: ^0.2.1
shiki: ^0.11.1 shiki: ^0.11.1
std-env: ^3.3.1
theme-vitesse: ^0.6.0 theme-vitesse: ^0.6.0
tippy.js: ^6.3.7 tippy.js: ^6.3.7
typescript: ^4.9.3 typescript: ^4.9.3
@ -101,6 +102,7 @@ devDependencies:
prettier: 2.8.0 prettier: 2.8.0
rollup-plugin-node-polyfills: 0.2.1 rollup-plugin-node-polyfills: 0.2.1
shiki: 0.11.1 shiki: 0.11.1
std-env: 3.3.1
theme-vitesse: 0.6.0 theme-vitesse: 0.6.0
tippy.js: 6.3.7 tippy.js: 6.3.7
typescript: 4.9.3 typescript: 4.9.3

View file

@ -2,6 +2,7 @@
import _fs from 'unstorage/drivers/fs' import _fs from 'unstorage/drivers/fs'
// @ts-expect-error unstorage needs to provide backwards-compatible subpath types // @ts-expect-error unstorage needs to provide backwards-compatible subpath types
import _kv from 'unstorage/drivers/cloudflare-kv-http' import _kv from 'unstorage/drivers/cloudflare-kv-http'
import { isCI } from 'std-env'
import { $fetch } from 'ohmyfetch' import { $fetch } from 'ohmyfetch'
import type { Storage } from 'unstorage' import type { Storage } from 'unstorage'
@ -13,14 +14,14 @@ import { APP_NAME } from '~/constants'
const runtimeConfig = useRuntimeConfig() const runtimeConfig = useRuntimeConfig()
export const HOST_DOMAIN = runtimeConfig.deployUrl export const HOST_DOMAIN = runtimeConfig.deployUrl
|| (process.dev ? 'http://localhost:5314' : 'https://elk.zone') || (process.dev || !isCI ? 'http://localhost:5314' : 'https://elk.zone')
const fs = _fs as typeof import('unstorage/dist/drivers/fs')['default'] const fs = _fs as typeof import('unstorage/dist/drivers/fs')['default']
const kv = _kv as typeof import('unstorage/dist/drivers/cloudflare-kv-http')['default'] const kv = _kv as typeof import('unstorage/dist/drivers/cloudflare-kv-http')['default']
const storage = useStorage() as Storage const storage = useStorage() as Storage
if (process.dev) { if (process.dev || !isCI) {
storage.mount('servers', fs({ base: 'node_modules/.cache/servers' })) storage.mount('servers', fs({ base: 'node_modules/.cache/servers' }))
} }
else { else {