Skip to content

Commit a6f0050

Browse files
committed
타입스크립트 제거
- env 값 조정
1 parent eb60f7f commit a6f0050

44 files changed

Lines changed: 301 additions & 500 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:20.5.0-slim
1+
FROM node:20.5.1-slim
22

33
WORKDIR /app
44
COPY . /app

package.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "goose-manager",
3-
"version": "2.4.0",
3+
"version": "2.4.1",
44
"main": "index.js",
55
"private": false,
66
"license": "MIT",
@@ -28,21 +28,19 @@
2828
"dependencies": {
2929
"cookie-parser": "^1.4.6",
3030
"express": "^4.18.2",
31-
"ofetch": "^1.3.2"
31+
"ofetch": "^1.3.3"
3232
},
3333
"devDependencies": {
34-
"@redgoose/json-editor": "^1.0.7",
34+
"@redgoose/json-editor": "^1.0.10",
3535
"@redgoose/markdown-style": "^1.1.6",
36-
"@types/node": "^20.5.4",
37-
"@vitejs/plugin-vue": "^4.3.3",
36+
"@vitejs/plugin-vue": "^4.3.4",
3837
"croppie": "^2.6.5",
3938
"esbuild": "^0.19.2",
4039
"image-resize": "^1.3.2",
41-
"marked": "^7.0.4",
40+
"marked": "^8.0.0",
4241
"nodemon": "^3.0.1",
4342
"pinia": "^2.1.6",
4443
"sass": "^1.66.1",
45-
"typescript": "^5.2.2",
4644
"vite": "^4.4.9",
4745
"vue": "^3.3.4",
4846
"vue-router": "^4.2.4",

src/app.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const layout = computed(() => {
3737
})
3838
3939
// children component error
40-
if (!DEVELOPMENT)
40+
if (!import.meta.env.DEV)
4141
{
4242
onErrorCaptured((e) => {
4343
if (typeof e === 'string')

src/libs/api.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { ofetch } from 'ofetch'
22
import { authStore } from '../store/auth'
33
import { getPath, serialize } from './string'
44

5+
const { VITE_API_URL } = import.meta.env
56
let instance
67
let headers
78
let timer
@@ -10,7 +11,7 @@ function setup()
1011
{
1112
const auth = authStore()
1213
instance = ofetch.create({
13-
baseURL: API_URL,
14+
baseURL: VITE_API_URL,
1415
retry: 0,
1516
responseType: 'json',
1617
})
@@ -75,7 +76,7 @@ function refreshToken(token)
7576
const delay = 2000
7677
if (timer) clearTimeout(timer)
7778
timer = setTimeout(async () => {
78-
let res = await ofetch(getPath(`${BASE_URL}/local/refresh-token/`), {
79+
let res = await ofetch(getPath(`${import.meta.env.VITE_BASE_URL}/local/refresh-token/`), {
7980
method: 'post',
8081
responseType: 'json',
8182
retry: 0,

src/libs/error.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
const { VITE_DEBUG } = import.meta.env
2+
13
export function err(path, type = 'warning', message)
24
{
3-
if (!window.DEBUG) return
5+
if (VITE_DEBUG !== 'true') return
46
console.error(path.join('/'), `${type.toUpperCase()}`, message)
57
}

src/libs/storage.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
const prefix = STORAGE_PREFIX || 'goose'
1+
const { VITE_STORAGE_PREFIX } = import.meta.env
2+
const prefix = VITE_STORAGE_PREFIX || 'goose'
23

34
/**
45
* check localStorage

src/main.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ import App from './app.vue'
99
// set stylesheet
1010
import './assets/scss/main.scss'
1111

12-
// set global values
13-
window.DEBUG = DEBUG
14-
window.DEVELOPMENT = DEVELOPMENT
15-
1612
// setup pinia
1713
const pinia = createPinia()
1814

src/pages/auth/login.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,12 @@ import { getPath } from '../../libs/string'
7878
import FormCheckbox from '../../components/forms/checkbox.vue'
7979
import { ButtonBasic } from '../../components/button'
8080
81+
const { VITE_TITLE, VITE_DESCRIPTION, VITE_BASE_URL } = import.meta.env
8182
const router = useRouter()
8283
const auth = authStore()
8384
const loading = ref(false)
84-
const title = ref(import.meta.env.VITE_TITLE || '매니저')
85-
const description = ref(DESCRIPTION || '매니저 설명')
85+
const title = ref(VITE_TITLE || '매니저')
86+
const description = ref(VITE_DESCRIPTION || '매니저 설명')
8687
const processing = ref(false)
8788
const forms = reactive({
8889
email: '',
@@ -97,7 +98,7 @@ async function onSubmit()
9798
// on loading
9899
loading.value = true
99100
// request api
100-
const { success, message, data } = await $fetch(getPath(`${BASE_URL}/local/login/`), {
101+
const { success, message, data } = await $fetch(getPath(`${VITE_BASE_URL}/local/login/`), {
101102
method: 'post',
102103
responseType: 'json',
103104
body: {

src/pages/error/500.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,13 @@ import { iconRandomPick } from '../../components/icons/assets'
2525
import { ButtonBasic } from '../../components/button'
2626
import Icon from '../../components/icons/index.vue'
2727
28+
const { VITE_DEBUG } = import.meta.env
2829
const props = defineProps({
2930
error: Error,
3031
})
3132
const iconName = iconRandomPick()
3233
const description = computed(() => {
33-
return (window.DEBUG && props.error?.message) ? props.error.message : '알 수 없는 오류가 발생했습니다.'
34+
return ((VITE_DEBUG === 'true') && props.error?.message) ? props.error.message : '알 수 없는 오류가 발생했습니다.'
3435
})
3536
</script>
3637

src/pages/preference/general.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,15 @@ import { Fieldset, Field, Help } from '../../components/forms/fieldset'
4242
import { FormSelect } from '../../components/forms'
4343
import { Controller } from '../../components/navigation'
4444
import { ButtonBasic } from '../../components/button'
45+
import pkg from '../../../package.json'
4546
46-
const version = VERSION || undefined
47+
const { VITE_TITLE } = import.meta.env
48+
const version = pkg.version || undefined
4749
4850
const preference = preferenceStore()
4951
const head = headStore()
5052
const fields = reactive({
51-
title: import.meta.env.VITE_TITLE,
53+
title: VITE_TITLE,
5254
version,
5355
theme: {
5456
value: head.theme,

0 commit comments

Comments
 (0)