update for build

This commit is contained in:
SrGooglo 2025-02-11 16:38:46 +00:00
parent 6c6cb2b609
commit 89a5b30a90
7 changed files with 268 additions and 298 deletions

View File

@ -0,0 +1,59 @@
* [+16/-16][utils] [fix argus](https://github.com/ragestudio/comty/commit/6c6cb2b609303a8bdb685639479ee4ea4e8416bf) - by [@SrGooglo](https://github.com/srgooglo)
* [+1/-1][app] [update ignore](https://github.com/ragestudio/comty/commit/bd79c2d7cf6a15c6532b7b1693c3399bf9d3212f) - by [@SrGooglo](https://github.com/srgooglo)
* [+1/-1][internal] [update external](https://github.com/ragestudio/comty/commit/f8eb297ab310a5a1439c94b17f1a8304cd425ec2) - by [@SrGooglo](https://github.com/srgooglo)
* [+3/-1][app] [update gitignore](https://github.com/ragestudio/comty/commit/e5365ae2e2eebd0867cfe207f04fd538cd0b6471) - by [@SrGooglo](https://github.com/srgooglo)
* [+44/-43][server] [return items](https://github.com/ragestudio/comty/commit/f70c9ff53ee07c7e31f3009fafbac2b6bd87332b) - by [@SrGooglo](https://github.com/srgooglo)
* [+420/-404][app] [use swappy](https://github.com/ragestudio/comty/commit/bca40318bdade6161675355dde4bb602d77c45a3) - by [@SrGooglo](https://github.com/srgooglo)
* [+32/-61][app] [replace plyr](https://github.com/ragestudio/comty/commit/7ae3c19e7dce0abf5d9dbd6b55b94da7c7d5dfd1) - by [@SrGooglo](https://github.com/srgooglo)
* [+8/-0][app] [tweak muxer](https://github.com/ragestudio/comty/commit/afa989b62758c8d6344e797a9ee6c0701c4a3a91) - by [@SrGooglo](https://github.com/srgooglo)
* [+7/-7][app] [remove temporaly mediasession](https://github.com/ragestudio/comty/commit/e4a6bfd4472c2d28e7e6fe2b9a37a61b7e0b609c) - by [@SrGooglo](https://github.com/srgooglo)
* [+208/-115][app] [update _debugs](https://github.com/ragestudio/comty/commit/14234ffa6ca0a59f7c15d36dfc8af999a93bd256) - by [@SrGooglo](https://github.com/srgooglo)
* [+0/-0][app] [rename](https://github.com/ragestudio/comty/commit/10759e0cef2b625085b2aa074bba45cdc3ad18be) - by [@SrGooglo](https://github.com/srgooglo)
* [+95/-86][app] [improve explore tab](https://github.com/ragestudio/comty/commit/d21ca837dc6197cef3dd75a04df99407de0d4f24) - by [@SrGooglo](https://github.com/srgooglo)
* [+37/-41][app] [formaat](https://github.com/ragestudio/comty/commit/8b98a60f82dd612eaf74778e2d58b1a2777fe468) - by [@SrGooglo](https://github.com/srgooglo)
* [+63/-128][app] [improve setting load](https://github.com/ragestudio/comty/commit/a70871293581ec3021b15bf311de407d0137032e) - by [@SrGooglo](https://github.com/srgooglo)
* [+12/-282][app] [remove splash styles](https://github.com/ragestudio/comty/commit/41e34f35c01a08a829047d3e2ae104aed77bfe3e) - by [@SrGooglo](https://github.com/srgooglo)
* [+2926/-2856][app] [fix depecrated deps](https://github.com/ragestudio/comty/commit/3cf055c72c7799ae9835a850fed914264af0afc8) - by [@SrGooglo](https://github.com/srgooglo)
* [+49/-26][app] [fix log](https://github.com/ragestudio/comty/commit/79f64eaec289f89ee65cb1bb628bf4cef159862f) - by [@SrGooglo](https://github.com/srgooglo)
* [+49/-171][app] [update licenses](https://github.com/ragestudio/comty/commit/c9b485991e39fad9d19fd89d7ff0703dbdfa39a7) - by [@SrGooglo](https://github.com/srgooglo)
* [+112/-110][server] [fix 500 when no metadata provided](https://github.com/ragestudio/comty/commit/78d0ec0e30aed4636eb7b90678cb4cda246204bd) - by [@SrGooglo](https://github.com/srgooglo)
* [+200/-20][app] [add splash screen](https://github.com/ragestudio/comty/commit/aa5209d225a3317ae81e4979e1cf3c39e0b3acfd) - by [@SrGooglo](https://github.com/srgooglo)
* [+1/-36][app] [remove unused utils](https://github.com/ragestudio/comty/commit/79b1f620a3f7dbe47596a2c0e787b80186c802de) - by [@SrGooglo](https://github.com/srgooglo)
* [+169/-166][app] [improve track cover image render](https://github.com/ragestudio/comty/commit/06dcf0b96170c509342d3a5e3be6c1da6bc62705) - by [@SrGooglo](https://github.com/srgooglo)
* [+325/-537][wrapper | package.json | src] [rewrite wrapper](https://github.com/ragestudio/comty/commit/54c7c3c59d92dec44c41dc09e53d07a52e9079b8) - by [@SrGooglo](https://github.com/srgooglo)
* [+3/-3][app | server] [update version](https://github.com/ragestudio/comty/commit/028f14f12b05471f2e0f8e6b03c865f71005d6f7) - by [@SrGooglo](https://github.com/srgooglo)
* [+16/-1][app] [support for parse times](https://github.com/ragestudio/comty/commit/342cc34d65ea316e7fd00a88fb71e47456768abc) - by [@SrGooglo](https://github.com/srgooglo)
* [+206/-190][app] [improve overrides](https://github.com/ragestudio/comty/commit/dde659ef010f4b17e6b079d6c169a757ad0c4e63) - by [@SrGooglo](https://github.com/srgooglo)
* [+1/-0][server] [added deps](https://github.com/ragestudio/comty/commit/3b04ef604404811e89557177c93a91975e0748c3) - by [@SrGooglo](https://github.com/srgooglo)
* [+17/-0][server] [added `trackOverride` db model](https://github.com/ragestudio/comty/commit/c63e9288f2aeddca30f6e24304025e4c87fa0019) - by [@SrGooglo](https://github.com/srgooglo)
* [+85/-0][server] [added basic search endpoint](https://github.com/ragestudio/comty/commit/e9a6fa9c7ef09148df18fa2f017508b689329495) - by [@SrGooglo](https://github.com/srgooglo)
* [+305/-187][server] [use new items list standart](https://github.com/ragestudio/comty/commit/9c9fa4c18b6e026c4d2f871be31171235e917843) - by [@SrGooglo](https://github.com/srgooglo)

View File

@ -1,6 +1,6 @@
services: services:
app: wrapper:
build: packages/app build: packages/wrapper
restart: unless-stopped restart: unless-stopped
networks: networks:
- internal_network - internal_network

View File

@ -1,4 +1,5 @@
{ {
"version": "1.25.0@alpha",
"author": "RageStudio", "author": "RageStudio",
"license": "ComtyLicense", "license": "ComtyLicense",
"private": true, "private": true,

View File

@ -1,6 +1,6 @@
{ {
"name": "@comty/app", "name": "@comty/app",
"version": "1.25.0-a", "version": "1.25.0@alpha",
"license": "ComtyLicense", "license": "ComtyLicense",
"main": "electron/main", "main": "electron/main",
"type": "module", "type": "module",

View File

@ -1,6 +1,6 @@
{ {
"name": "@comty/server", "name": "@comty/server",
"version": "1.25.0-a", "version": "1.25.0@alpha",
"license": "ComtyLicense", "license": "ComtyLicense",
"private": true, "private": true,
"workspaces": [ "workspaces": [

View File

@ -1,103 +0,0 @@
import path from "node:path"
import fs from "node:fs"
import HyperExpress from "hyper-express"
import LiveDirectory from "live-directory"
const { WebSocket: WSClient } = require("ws")
const http = require("http")
// CONFIGURATION CONSTANTS
const publicPath = path.resolve(process.cwd(), "public")
const TARGET_HTTP = "http://localhost:9000"
const TARGET_WS = "ws://localhost:8080"
const LISTENT_PORT = 9999
async function main() {
if (!fs.existsSync(publicPath)) {
console.log("Public path does not exist, creating...")
fs.mkdirSync(publicPath)
}
const app = new HyperExpress.Server()
const liveDirectory = new LiveDirectory(publicPath)
app.any("/*", async (req, res) => {
if (req.url.startsWith("/api")) {
return handleApiProxyRequest(req, res)
}
return handleStaticFileRequest(liveDirectory, req, res)
})
await app.listen(LISTENT_PORT)
console.log(`LISTENING on port ${LISTENT_PORT}`)
}
async function handleStaticFileRequest(liveDirectory, req, res) {
let file = liveDirectory.get(req.path)
if (file === undefined) {
file = liveDirectory.get("index.html")
}
if (file === undefined) {
return res.status(404).json({ error: "Not found" })
}
const fileParts = file.path.split(".")
const extension = fileParts[fileParts.length - 1]
// Retrieve the file content and serve it depending on the type of content available for this file
const content = file.content
if (content instanceof Buffer) {
// Set appropriate mime-type and serve file content Buffer as response body (This means that the file content was cached in memory)
return res.type(extension).send(content)
} else {
// Set the type and stream the content as the response body (This means that the file content was NOT cached in memory)
return res.type(extension).stream(content)
}
}
async function handleApiProxyRequest(request, response) {
try {
const targetURL = new URL(request.url, TARGET_HTTP)
const headers = { ...request.headers, host: targetURL.host }
// Configurar la solicitud al servidor de destino
const proxyReq = http.request({
hostname: targetURL.hostname,
port: targetURL.port || 80,
path: targetURL.pathname + targetURL.search,
method: request.method,
headers,
})
// Manejar la respuesta del servidor de destino
proxyReq.on("response", (proxyRes) => {
response.status(proxyRes.statusCode)
// Copiar headers
Object.entries(proxyRes.headers).forEach(([key, val]) => {
response.header(key, val)
})
// Pipe de la respuesta
proxyRes.pipe(response.stream)
})
// Manejar errores
proxyReq.on("error", (error) => {
response.status(500).send(`Proxy error: ${error.message}`)
})
// Pipe del cuerpo de la solicitud
request.stream().pipe(proxyReq)
} catch (error) {
console.error(error)
response.status(500).send("Internal Server Error")
}
}
main()

View File

@ -29,7 +29,7 @@ async function main() {
} }
const octokit = new Octokit({ const octokit = new Octokit({
auth: process.env.GITHUB_TOKEN auth: process.env.GITHUB_TOKEN,
}) })
let steps = { let steps = {
@ -41,6 +41,8 @@ async function main() {
changelog: true, changelog: true,
} }
let changelogData = null
if (process.argv.includes("--no-pack")) { if (process.argv.includes("--no-pack")) {
steps.bundle = false steps.bundle = false
} }
@ -63,12 +65,17 @@ async function main() {
// check if is any changes pending to commit // check if is any changes pending to commit
if (!steps.ignoreCommits) { if (!steps.ignoreCommits) {
const gitStatus = child_process.execSync("git status --porcelain", { const gitStatus = child_process
cwd: process.cwd() .execSync("git status --porcelain", {
}).toString().trim() cwd: process.cwd(),
})
.toString()
.trim()
if (gitStatus.length > 0) { if (gitStatus.length > 0) {
console.warn("There are pending changes to commit, please commit first.") console.warn(
"There are pending changes to commit, please commit first.",
)
return false return false
} }
} }
@ -76,10 +83,12 @@ async function main() {
let currentVersion = packagejson.version let currentVersion = packagejson.version
// check if currentVersion match with current latest release on github // check if currentVersion match with current latest release on github
const latestRelease = await octokit.repos.getLatestRelease({ const latestRelease = await octokit.repos
.getLatestRelease({
owner: repo.split("/")[0], owner: repo.split("/")[0],
repo: repo.split("/")[1] repo: repo.split("/")[1],
}).catch((err) => { })
.catch((err) => {
console.error(`🆘 Failed to get latest release: ${err}`) console.error(`🆘 Failed to get latest release: ${err}`)
return false return false
}) })
@ -92,12 +101,13 @@ async function main() {
if (!steps.ignoreVersion) { if (!steps.ignoreVersion) {
if (latestRelease && latestRelease.data.tag_name === currentVersion) { if (latestRelease && latestRelease.data.tag_name === currentVersion) {
if (process.argv.includes("--bump")) { if (process.argv.includes("--bump")) {
const bumpType = process.argv[process.argv.indexOf("--bump") + 1] const bumpType =
process.argv[process.argv.indexOf("--bump") + 1]
const newVersion = await bumpVersion({ const newVersion = await bumpVersion({
root: process.cwd(), root: process.cwd(),
type: bumpType, type: bumpType,
count: 1 count: 1,
}).catch((error) => { }).catch((error) => {
console.error(`🆘 Failed to bump version >`, error) console.error(`🆘 Failed to bump version >`, error)
return false return false
@ -110,18 +120,23 @@ async function main() {
currentVersion = newVersion currentVersion = newVersion
// create new commit // create new commit
await child_process.execSync(`git add . && git commit -m "Bump version to ${currentVersion}"`, { await child_process.execSync(
`git add . && git commit -m "Bump version to ${currentVersion}"`,
{
cwd: process.cwd(), cwd: process.cwd(),
stdio: "inherit" stdio: "inherit",
}) },
)
// push to remote // push to remote
await child_process.execSync(`git push`, { await child_process.execSync(`git push`, {
cwd: process.cwd(), cwd: process.cwd(),
stdio: "inherit" stdio: "inherit",
}) })
} else { } else {
console.log("🚫 Current version is already latest version, please bump version first. \n - use --bump <patch|minor|major> to automatically bump version. \n - use --ignore-version to force release.") console.log(
"🚫 Current version is already latest version, please bump version first. \n - use --bump <patch|minor|major> to automatically bump version. \n - use --ignore-version to force release.",
)
return true return true
} }
} }
@ -136,14 +151,17 @@ async function main() {
} }
if (steps.changelog) { if (steps.changelog) {
const changelog = await composeChangelog() changelogData = await composeChangelog()
steps.changelog = path.resolve(changelogsPath, `v${currentVersion.split(".").join("-")}.md`) steps.changelog = path.resolve(
changelogsPath,
`v${currentVersion.split(".").join("-")}.md`,
)
console.log(`📝 Writing changelog to file > ${steps.changelog}`) console.log(`📝 Writing changelog to file > ${steps.changelog}`)
// write changelog to file // write changelog to file
fs.writeFileSync(steps.changelog, changelog) fs.writeFileSync(steps.changelog, changelogData)
} }
if (steps.publish) { if (steps.publish) {
@ -151,7 +169,7 @@ async function main() {
repo, repo,
{ {
version: currentVersion, version: currentVersion,
changelog, changelog: changelogData,
}, },
process.env.GITHUB_TOKEN, process.env.GITHUB_TOKEN,
).catch((err) => { ).catch((err) => {
@ -165,21 +183,16 @@ async function main() {
return false return false
} }
const assets = await uploadAssets( const assets = await uploadAssets(octokit, repo, release, [
octokit,
repo,
release,
[
{ {
name: packedDistPath, name: packedDistPath,
data: fs.readFileSync(packedDistPath) data: fs.readFileSync(packedDistPath),
}, },
{ {
name: "changelog.md", name: "changelog.md",
data: fs.readFileSync(steps.changelog) data: fs.readFileSync(steps.changelog),
} },
], ])
)
console.log("🎉 Assets uploaded! >", assets) console.log("🎉 Assets uploaded! >", assets)