Skip to content

Commit

Permalink
ci
Browse files Browse the repository at this point in the history
  • Loading branch information
tachibana-shin committed Oct 17, 2023
1 parent df4731b commit f4a8f6e
Show file tree
Hide file tree
Showing 34 changed files with 50 additions and 68 deletions.
5 changes: 1 addition & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@
"ionic.previewInEditor": true,
"vue-i18n.i18nPaths": "src/i18n",
"i18n-ally.keystyle": "flat",
"i18n-ally.localesPaths": [
"src/i18n",
"src/i18n/messages"
],
"i18n-ally.localesPaths": ["src/i18n", "src/i18n/messages"],
"i18n-ally.extract.ignoredByFiles": {
"src/components/BrtPlayer.vue": ["Space", "Space"],
"src/pages/[_type-normal]/[value].vue": [""],
Expand Down
1 change: 0 additions & 1 deletion npm/raiku-pgs/lib/plugin/parseAnchor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export function parseAnchor(
readonly path: string
readonly name: string
} {

const path = parsePath(anchor.attr("href")!)!
const name = anchor.text().trim()

Expand Down
1 change: 0 additions & 1 deletion npm/raiku-pgs/lib/thread/exec-package-mjs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export async function execPackageMjs(code: string, devMode: boolean) {
// setup port
const codeWorker = `${
devMode ? code : `!(()=>{${code}})()`
};${appendWorkerExecPackageMjs.replace(/process\.env\.DEV/g, devMode + "")}`
// eslint-disable-next-line n/no-unsupported-features/node-builtins
const url = URL.createObjectURL(
Expand Down
19 changes: 16 additions & 3 deletions npm/raiku-pgs/lib/thread/private/code/append-worker-plugin-mjs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@
import { listen, ping, put } from "@fcanvas/communicate"
import type { GetOption } from "client-ext-animevsub-helper"

import type { API, AppMode, ComicChapter, FetchGet, FetchPost } from "../../../API"
import type {
API,
AppMode,
ComicChapter,
FetchGet,
FetchPost
} from "../../../API"
import type { ListenerThread } from "../../create-worker-plugin"
import { parseDom } from "../../parseDom"
ping(self, "load")
Expand All @@ -16,11 +22,18 @@ export type ListenerWorker = {
api: (type: string, args: any[]) => any[]
// eslint-disable-next-line @typescript-eslint/no-explicit-any
get: (type: string) => any
"servers:has": (conf: ComicChapter, mode: AppMode) => readonly {
"servers:has": (
conf: ComicChapter,
mode: AppMode
) => readonly {
readonly id: number
readonly name: string
}[]
"servers:parse": (id: number, conf: ComicChapter, mode: AppMode) => readonly string[]
"servers:parse": (
id: number,
conf: ComicChapter,
mode: AppMode
) => readonly string[]
}

Object.assign(self, { parseDom })
Expand Down
2 changes: 1 addition & 1 deletion npm/raiku-pgs/lib/wrap-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function PostWorker<Fn extends (...args: any) => any>(
worker.addEventListener("message", (event: MessageEvent) => {
if (event.data.id === id) {
worker.terminate()

resolve(event.data.result)
}
})
Expand Down
2 changes: 1 addition & 1 deletion npm/raiku-pgs/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default defineConfig({
name: "RaikuPgs",
formats: ["cjs", "es"],

fileName: (format, entry) => (entry + (format === "es" ? ".js" : ".cjs")),
fileName: (format, entry) => entry + (format === "es" ? ".js" : ".cjs")
},
rollupOptions: {
// make sure to externalize deps that shouldn't be bundled
Expand Down
1 change: 0 additions & 1 deletion quasar.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ export default configure((/* ctx */) => {
}
: process.env.CODESPACE_NAME
? {

host: `${process.env.CODESPACE_NAME}-9000.${process.env
.GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN!}`,
protocol: "wss",
Expand Down
8 changes: 2 additions & 6 deletions scripts/bumpp-android.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


import { spawnSync } from "child_process"
import { readFileSync, writeFileSync } from "fs"
import { resolve } from "path"
Expand Down Expand Up @@ -93,10 +91,8 @@ async function bumppAndroid() {
const value =
name === "next"
? semver.parse(currentVersionName)?.prerelease?.length
?
semver.inc(currentVersionName, "prerelease")!
:
semver.inc(currentVersionName, "patch")!
? semver.inc(currentVersionName, "prerelease")!
: semver.inc(currentVersionName, "patch")!
: new SemVer(currentVersionName).inc(name)

return { title: `${name.padStart(PADDING, " ")} ${value}`, value }
Expand Down
7 changes: 2 additions & 5 deletions scripts/bumpp-ios.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import { spawnSync } from "child_process"
import { readFileSync, writeFileSync } from "fs"
import { resolve } from "path"
Expand Down Expand Up @@ -100,10 +99,8 @@ async function bumppiOS() {
const value =
name === "next"
? semver.parse(currentVersionName)?.prerelease?.length
?
semver.inc(currentVersionName, "prerelease")!
:
semver.inc(currentVersionName, "patch")!
? semver.inc(currentVersionName, "prerelease")!
: semver.inc(currentVersionName, "patch")!
: new SemVer(currentVersionName).inc(name)

return { title: `${name.padStart(PADDING, " ")} ${value}`, value }
Expand Down
1 change: 0 additions & 1 deletion src/boot/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import type { Ref } from "vue"
import { watch } from "vue"
import { createI18n } from "vue-i18n"


declare module "vue-i18n" {
// define the datetime format schema
export interface DefineDateTimeFormat {}
Expand Down
1 change: 0 additions & 1 deletion src/components/PluginAddDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ async function addPlugin() {
break
default:
message = t("loi-khi-them-plugin", [
import.meta.env.DEV ? ` (${err})` : ""
])
}
Expand Down
1 change: 0 additions & 1 deletion src/components/app/AppHeaderSearchMB.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ const allPlugins = computed(() =>
const keyword = ref("")
const query = ref((route.query.query ?? "") + "")
const { data: searchResult, runAsync } = useRequest(
() => {
Expand Down
2 changes: 0 additions & 2 deletions src/components/library/_components/DialogDLManga.vue
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,6 @@ watch(showDownloadMore, async (state) => {
allEp.value = episodes
} catch (err) {
$q.notify({
message: err + ""
})
}
Expand Down Expand Up @@ -365,7 +364,6 @@ async function download() {
ep_name: ep.name,
ep_param: chap,
pages: await plugin["servers:parse"](0, conf, APP_MODE)
}).then((result) => {
if (lsEpDL.value && !isTaskDLEp(result)) {
lsEpDL.value.splice(
Expand Down
5 changes: 2 additions & 3 deletions src/components/truyen-tranh/ListChapters.vue
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ const pluginStore = usePluginStore()
const segments = computed(() => {
return unflat(props.chapters, 50).map((items) => {
const [from, to] = [
parseFloat((items[0].name)) || items[0].name,
parseFloat((items.at(-1)!.name)) || items.at(-1)!.name
parseFloat(items[0].name) || items[0].name,
parseFloat(items.at(-1)!.name) || items.at(-1)!.name
]
return { from, to, items }
Expand Down Expand Up @@ -231,7 +231,6 @@ async function downloadEp(item: Chapter) {
false
)
const task = await IDMStore.download(props.metaManga!, {
ep_id: item.id,
ep_name: item.name,
Expand Down
1 change: 0 additions & 1 deletion src/components/truyen-tranh/ep/BtnDownload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ function onClickDownload() {
noCaps: true,
flat: true
}
}).onOk(async () => {
if (props.mangaId !== null && props.epId !== null)
await deleteEpisode(props.mangaId, props.epId)
Expand Down
2 changes: 1 addition & 1 deletion src/components/truyen-tranh/ep/FloatingStatus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
}}
</div>
<div>
{{ $t("ep-name", [metaEp ? (metaEp?.name) : "_"]) }}
{{ $t("ep-name", [metaEp ? metaEp?.name : "_"]) }}
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/truyen-tranh/ep/FloatingStatusMobile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
>
{{ Math.abs(currentPage) + 1 - sizeOldPages }}/{{ sizePage - sizeOldPages
}}<span class="ml-2">{{
$t("ep-name", [metaEp ? (metaEp.name) : "_"])
$t("ep-name", [metaEp ? metaEp.name : "_"])
}}</span>
</div>
</template>
Expand Down
1 change: 1 addition & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { AppMode } from "raiku-pgs/plugin"
import type { FunctionalComponent, SVGAttributes } from "vue"

import iconamoonSearch from "~icons/iconamoon/search"
Expand Down
1 change: 0 additions & 1 deletion src/logic/bus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export class EventBus<Events extends Record<string, unknown[]>> {
if (!(name in this.events))
this.events[name] = new Set<(...args: unknown[]) => void>()


this.events[name]!.add(cb)

if (instance) onBeforeUnmount(() => this.off(name, cb), instance)
Expand Down
4 changes: 0 additions & 4 deletions src/logic/download-manager.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

/* eslint-disable camelcase */
import hashSum from "hash-sum"
import { cleanup, exists, readdir, readFile } from "test/vitest/utils"
Expand Down Expand Up @@ -53,7 +52,6 @@ function patchFetch() {
async (url: string) => {
await sleep(100)
return Promise.resolve({

async arrayBuffer() {
return new TextEncoder().encode(url)
},
Expand Down Expand Up @@ -170,7 +168,6 @@ describe("download-manager", () => {
if (counter++ > 5) return Promise.reject(new Error("time_out"))

return Promise.resolve({

async arrayBuffer() {
return new TextEncoder().encode(url)
},
Expand Down Expand Up @@ -244,7 +241,6 @@ describe("download-manager", () => {
if (counter++ > 5) return Promise.reject(new Error("time_out"))

return Promise.resolve({

async arrayBuffer() {
return new TextEncoder().encode(url)
},
Expand Down
1 change: 0 additions & 1 deletion src/logic/download-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ export function createTaskDownloadEpisode(
// delay 1s
clearTimeout(timeout)


timeout = setTimeout(async () => {
try {
await Filesystem.writeFile({
Expand Down
1 change: 0 additions & 1 deletion src/logic/formatView.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const levels = ["N", "Tr", "T", "V"]

export function formatView(view: number): string {

if (view < 1000) return view + ""
const index = levels.findIndex(() => {
view /= 1000
Expand Down
1 change: 0 additions & 1 deletion src/logic/sakura.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ function createSakura(x1: number, y1: number, x2: number, y2: number): Sakura {
export function useSakura(element: HTMLCanvasElement) {
const sakura = new Set<Sakura>()


const ctx = element.getContext("2d")!

let stopped = false
Expand Down
1 change: 0 additions & 1 deletion src/logic/to-type.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

const { toString } = Object.prototype

// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down
1 change: 0 additions & 1 deletion src/logic/with-cache.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import { expect } from "vitest"

const value = { v: Math.random() }
Expand Down
1 change: 0 additions & 1 deletion src/pages/app/settings/check-network.vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ const IP = computedAsync(() => {
return fetch("https://freeipapi.com/api/json")
.then((res) => res.json())
.then((res) => {
return `${res.ipAddress} - ${res.regionName} (${res.countryName})`
})
})
Expand Down
2 changes: 1 addition & 1 deletion src/pages/app/sign-in.vue
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ async function login() {
data.user.user_metadata.name ?? data.user.email
])
})
void router.push((route.query.redirectTo ?? "/") + "")
}
</script>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/genre/[[type]].vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const paramSourceId = useRouteParams<string | null>("sourceId", undefined, {
const page = computed<number>({
get: () => parseInt(route.query.page?.toString() ?? "1") || 1,
set: (page) =>
router.push({
...route,
Expand Down
24 changes: 15 additions & 9 deletions src/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,18 @@ meta:
</div>
</div>
</swiper-slide>
<div v-if="$q.screen.gt.xs" class="pointer-events-none drop-left z-2"></div>
<div v-if="$q.screen.gt.xs" class="pointer-events-none drop-center z-2"></div>
<div v-if="$q.screen.gt.xs" class="pointer-events-none drop-right z-2"></div>
<div
v-if="$q.screen.gt.xs"
class="pointer-events-none drop-left z-2"
></div>
<div
v-if="$q.screen.gt.xs"
class="pointer-events-none drop-center z-2"
></div>
<div
v-if="$q.screen.gt.xs"
class="pointer-events-none drop-right z-2"
></div>

<transition v-if="$q.screen.gt.xs" name="q-transition--fade">
<div :key="sliderIndex" class="info pointer-events-none">
Expand All @@ -174,7 +183,7 @@ meta:
data.sliders[sliderIndex].othername
}}</small>
</div>
<div class=" focus-item-info">
<div class="focus-item-info">
<Quality v-if="data.sliders[sliderIndex].label">{{
data.sliders[sliderIndex].label
}}</Quality>
Expand All @@ -198,11 +207,11 @@ meta:
<!-- <i-fluent-eye-24-filled class="size-1.5em" /> -->
{{ formatView(data.sliders[sliderIndex].views!) }}
</div>
<div class=" mt-1 text-12px ellipsis">
<div class="mt-1 text-12px ellipsis">
{{ data.sliders[sliderIndex].tags.join(", ") }}
</div>
<div
class=" focus-item-desc text-gray-200 line-clamp-3 sm:line-clamp-2 md:line-clamp-5 !leading-normal"
class="focus-item-desc text-gray-200 line-clamp-3 sm:line-clamp-2 md:line-clamp-5 !leading-normal"
>
{{ data.sliders[sliderIndex].description }}
</div>
Expand Down Expand Up @@ -423,7 +432,6 @@ meta:
</template>

<script setup lang="ts">
// import data from "src/apis/parsers/__test__/assets/index.json"
import { formatView } from "src/logic/formatView"
import { unflat } from "src/logic/unflat"
Expand Down Expand Up @@ -504,15 +512,13 @@ function Carousel({ swiper, on }: any) {
".swiper-carousel-animate-opacity"
)
const translateX =
progress * scale * 50 * (swiper.rtlTranslate ? -1 : 1) + "%"
const scaleVal = 1 - 0.2 * absProgress
const zIndex = numSlides - Math.abs(Math.round(progress))
slide.style.transform = `translateX(${translateX}) scale(${scaleVal})`
slide.style.zIndex = zIndex
slide.style.opacity = absProgress > 3 ? 0 : 1
opacityEls.forEach((el: HTMLDivElement) => {
el.style.opacity = 1 - absProgress / 3 + ""
})
}
Expand Down
Loading

0 comments on commit f4a8f6e

Please sign in to comment.