mirror of
https://github.com/BioArchLinux/Rosa.git
synced 2025-03-10 12:02:43 +00:00
fix api base
This commit is contained in:
parent
165bf8c947
commit
504f00df48
5 changed files with 117 additions and 8 deletions
|
@ -14,7 +14,7 @@
|
||||||
</div>
|
</div>
|
||||||
<ul id="navbarlist">
|
<ul id="navbarlist">
|
||||||
<li><a href="https://bioarchlinux.org/">Home</a></li>
|
<li><a href="https://bioarchlinux.org/">Home</a></li>
|
||||||
<li><a href="/" class="active">Packages</a></li>
|
<li><a href="#" class="active">Packages</a></li>
|
||||||
<li><a href="https://matrix.to/#/#bioarchlinux:matrix.org">Chat</a></li>
|
<li><a href="https://matrix.to/#/#bioarchlinux:matrix.org">Chat</a></li>
|
||||||
<li><a href="https://wiki.bioarchlinux.org/">Wiki</a></li>
|
<li><a href="https://wiki.bioarchlinux.org/">Wiki</a></li>
|
||||||
<li><a href="https://repo.bioarchlinux.org/">Repository</a></li>
|
<li><a href="https://repo.bioarchlinux.org/">Repository</a></li>
|
||||||
|
|
100
frontend/package-lock.json
generated
100
frontend/package-lock.json
generated
|
@ -14,6 +14,7 @@
|
||||||
"vue-router": "^4.2.2"
|
"vue-router": "^4.2.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@rollup/plugin-replace": "^5.0.2",
|
||||||
"@vitejs/plugin-vue": "^4.2.3",
|
"@vitejs/plugin-vue": "^4.2.3",
|
||||||
"sass": "^1.62.1",
|
"sass": "^1.62.1",
|
||||||
"standard": "^17.1.0",
|
"standard": "^17.1.0",
|
||||||
|
@ -505,6 +506,67 @@
|
||||||
"node": ">= 8"
|
"node": ">= 8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@rollup/plugin-replace": {
|
||||||
|
"version": "5.0.2",
|
||||||
|
"resolved": "https://registry.npmmirror.com/@rollup/plugin-replace/-/plugin-replace-5.0.2.tgz",
|
||||||
|
"integrity": "sha512-M9YXNekv/C/iHHK+cvORzfRYfPbq0RDD8r0G+bMiTXjNGKulPnCT9O3Ss46WfhI6ZOCgApOP7xAdmCQJ+U2LAA==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@rollup/pluginutils": "^5.0.1",
|
||||||
|
"magic-string": "^0.27.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14.0.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"rollup": "^1.20.0||^2.0.0||^3.0.0"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"rollup": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@rollup/plugin-replace/node_modules/magic-string": {
|
||||||
|
"version": "0.27.0",
|
||||||
|
"resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.27.0.tgz",
|
||||||
|
"integrity": "sha512-8UnnX2PeRAPZuN12svgR9j7M1uWMovg/CEnIwIG0LFkXSJJe4PdfUGiTGl8V9bsBHFUtfVINcSyYxd7q+kx9fA==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@jridgewell/sourcemap-codec": "^1.4.13"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@rollup/pluginutils": {
|
||||||
|
"version": "5.0.2",
|
||||||
|
"resolved": "https://registry.npmmirror.com/@rollup/pluginutils/-/pluginutils-5.0.2.tgz",
|
||||||
|
"integrity": "sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==",
|
||||||
|
"dev": true,
|
||||||
|
"dependencies": {
|
||||||
|
"@types/estree": "^1.0.0",
|
||||||
|
"estree-walker": "^2.0.2",
|
||||||
|
"picomatch": "^2.3.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14.0.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"rollup": "^1.20.0||^2.0.0||^3.0.0"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"rollup": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@types/estree": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmmirror.com/@types/estree/-/estree-1.0.1.tgz",
|
||||||
|
"integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"node_modules/@types/json5": {
|
"node_modules/@types/json5": {
|
||||||
"version": "0.0.29",
|
"version": "0.0.29",
|
||||||
"resolved": "https://registry.npmmirror.com/@types/json5/-/json5-0.0.29.tgz",
|
"resolved": "https://registry.npmmirror.com/@types/json5/-/json5-0.0.29.tgz",
|
||||||
|
@ -3550,6 +3612,44 @@
|
||||||
"fastq": "^1.6.0"
|
"fastq": "^1.6.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@rollup/plugin-replace": {
|
||||||
|
"version": "5.0.2",
|
||||||
|
"resolved": "https://registry.npmmirror.com/@rollup/plugin-replace/-/plugin-replace-5.0.2.tgz",
|
||||||
|
"integrity": "sha512-M9YXNekv/C/iHHK+cvORzfRYfPbq0RDD8r0G+bMiTXjNGKulPnCT9O3Ss46WfhI6ZOCgApOP7xAdmCQJ+U2LAA==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@rollup/pluginutils": "^5.0.1",
|
||||||
|
"magic-string": "^0.27.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"magic-string": {
|
||||||
|
"version": "0.27.0",
|
||||||
|
"resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.27.0.tgz",
|
||||||
|
"integrity": "sha512-8UnnX2PeRAPZuN12svgR9j7M1uWMovg/CEnIwIG0LFkXSJJe4PdfUGiTGl8V9bsBHFUtfVINcSyYxd7q+kx9fA==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@jridgewell/sourcemap-codec": "^1.4.13"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@rollup/pluginutils": {
|
||||||
|
"version": "5.0.2",
|
||||||
|
"resolved": "https://registry.npmmirror.com/@rollup/pluginutils/-/pluginutils-5.0.2.tgz",
|
||||||
|
"integrity": "sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@types/estree": "^1.0.0",
|
||||||
|
"estree-walker": "^2.0.2",
|
||||||
|
"picomatch": "^2.3.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@types/estree": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmmirror.com/@types/estree/-/estree-1.0.1.tgz",
|
||||||
|
"integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"@types/json5": {
|
"@types/json5": {
|
||||||
"version": "0.0.29",
|
"version": "0.0.29",
|
||||||
"resolved": "https://registry.npmmirror.com/@types/json5/-/json5-0.0.29.tgz",
|
"resolved": "https://registry.npmmirror.com/@types/json5/-/json5-0.0.29.tgz",
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
"lint": "standard"
|
"lint": "standard"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@rollup/plugin-replace": "^5.0.2",
|
||||||
"@vitejs/plugin-vue": "^4.2.3",
|
"@vitejs/plugin-vue": "^4.2.3",
|
||||||
"sass": "^1.62.1",
|
"sass": "^1.62.1",
|
||||||
"standard": "^17.1.0",
|
"standard": "^17.1.0",
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
const API_PKGLIST = 'https://bioarchlinux.org/api/pkglist.json'
|
|
||||||
|
|
||||||
export
|
export
|
||||||
async function requestPackageList () {
|
async function requestPackageList () {
|
||||||
return await (await fetch('/api/pkglist.json')).json()
|
return await (await fetch(`${__API_BASE__}/api/pkglist.json`)).json()
|
||||||
}
|
}
|
||||||
|
|
||||||
export
|
export
|
||||||
async function requestPackageInfo (pkg) {
|
async function requestPackageInfo (pkg) {
|
||||||
return await (await fetch(`/api/${pkg}.json`)).json()
|
return await (await fetch(`${__API_BASE__}/api/${pkg}.json`)).json()
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,20 @@
|
||||||
import { fileURLToPath, URL } from 'node:url'
|
import { fileURLToPath, URL } from 'node:url'
|
||||||
|
|
||||||
import { defineConfig } from 'vite'
|
import { defineConfig } from 'vite'
|
||||||
|
import replace from '@rollup/plugin-replace'
|
||||||
import vue from '@vitejs/plugin-vue'
|
import vue from '@vitejs/plugin-vue'
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig(({command}) => { return {
|
||||||
plugins: [vue()],
|
plugins: [
|
||||||
|
replace({
|
||||||
|
// production / development environment api base
|
||||||
|
__API_BASE__: command === 'build' ? JSON.stringify('https://bioarchlinux.org/')
|
||||||
|
: JSON.stringify(''),
|
||||||
|
preventAssignment: true,
|
||||||
|
}),
|
||||||
|
vue(),
|
||||||
|
],
|
||||||
|
// for import alias
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'@': fileURLToPath(new URL('./src', import.meta.url))
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
||||||
|
@ -16,4 +26,4 @@ export default defineConfig({
|
||||||
'/api': 'https://bioarchlinux.org'
|
'/api': 'https://bioarchlinux.org'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
}})
|
||||||
|
|
Loading…
Add table
Reference in a new issue