Skip to content

Commit

Permalink
chore: 修改构建配置
Browse files Browse the repository at this point in the history
  • Loading branch information
aooiuu committed May 23, 2024
1 parent 3d5fdea commit 526232c
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/electron.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: electron
name: Electron

on:
push:
Expand Down
2 changes: 1 addition & 1 deletion packages/epub/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
"epub.d.ts"
],
"keywords": [],
"author": "aooiuu",
"author": "julien-c",
"license": "ISC"
}
54 changes: 29 additions & 25 deletions packages/web/electron-builder.json5
Original file line number Diff line number Diff line change
@@ -1,37 +1,41 @@
/**
* @see https://www.electron.build/configuration/configuration
*/
{
"appId": "any-reader",
"productName": "AnyReader",
"artifactName": "AnyReader_${version}.${ext}",
"asar": false,
"directories": {
"output": "dist/electron"
{
appId: 'io.github.any-reader',
productName: 'AnyReader',
artifactName: 'AnyReader_${version}.${ext}',
asar: true,
directories: {
output: 'dist/electron'
},
"files": [
"dist"
files: [
'dist/electron-js',
'dist/electron-template',
'!**/node_modules/**/*.map',
'!**/node_modules/**/*.md',
'!**/node_modules/**/*.ts',
'!**/node_modules/**/*.scss',
'!**/node_modules/.bin',
'!**/node_modules/*/{test,__tests__,tests,powered-test,example,examples}'
],
"mac": {
"target": [
"dmg"
]
mac: {
target: ['dmg']
},
"win": {
win: {
artifactName: '${productName}-win32-${arch}-${version}.${ext}',
// "icon": "public/icon.png",
"target": [
target: [
{
"target": "nsis",
"arch": [
"x64"
]
target: 'nsis',
arch: ['x64', 'ia32']
}
]
},
"nsis": {
"oneClick": false,
"perMachine": false,
"allowToChangeInstallationDirectory": true,
"deleteAppDataOnUninstall": false
nsis: {
oneClick: false,
perMachine: false,
allowToChangeInstallationDirectory: true,
deleteAppDataOnUninstall: false
}
}
}
8 changes: 4 additions & 4 deletions packages/web/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ export enum CONTENT_TYPE {
}

export const CONTENT_TYPES = [
{ value: 0, label: 'MANGA' },
{ value: 1, label: 'NOVEL' },
{ value: 2, label: 'VIDEO' },
{ value: 0, label: '漫画' },
{ value: 1, label: '小说' },
{ value: 2, label: '视频' },
// { value: 3, label: 'AUDIO' },
// { value: 4, label: 'RSS' },
// { value: 5, label: 'NOVELMORE' },

{ value: 101, label: 'GAME' }
{ value: 101, label: '游戏' }
];

export const PLATFORM: 'browser' | 'vscode' | 'electron' = import.meta.env.VITE_APP_PLATFORM;
Expand Down
4 changes: 2 additions & 2 deletions packages/web/src/pages/pc/search/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="flex-1 flex items-center gap-10">
<a-input-search v-model="searchText" placeholder="输入关键词,回车键搜索" class="!w-80" :disabled="loading" @keyup.enter="onSearch" />
<a-checkbox-group v-model="contentTypes" :disabled="loading">
<a-checkbox v-for="item in CONTENT_TYPES" :key="item.value" :value="item.value">
<a-checkbox v-for="item in CONTENT_TYPES.filter((e) => e.value !== CONTENT_TYPE.GAME)" :key="item.value" :value="item.value">
{{ item.label }}
</a-checkbox>
</a-checkbox-group>
Expand Down Expand Up @@ -62,7 +62,7 @@
<script setup lang="tsx">
import { v4 as uuidV4 } from 'uuid';
import pLimit from 'p-limit';
import { CONTENT_TYPES } from '@/constants';
import { CONTENT_TYPES, CONTENT_TYPE } from '@/constants';
import { searchByRuleId } from '@/api';
import { useFavoritesStore } from '@/stores/favorites';
import { useRulesStore } from '@/stores/rules';
Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/pages/vscode/search/index.vsc.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<template v-if="expand">
<!-- 规则类型 -->
<vscode-dropdown class="w-full" :value="'' + contentType" @input="(event:any) => (contentType = +event.target.value)">
<vscode-option v-for="item in CONTENT_TYPES" :key="item.value" :value="item.value">
<vscode-option v-for="item in CONTENT_TYPES.filter((e) => e.value !== CONTENT_TYPE.GAME)" :key="item.value" :value="item.value">
{{ item.label }}
</vscode-option>
</vscode-dropdown>
Expand Down
4 changes: 2 additions & 2 deletions packages/web/src/pages/vscode/search/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="flex-1 flex items-center gap-10">
<a-input-search v-model="searchText" placeholder="输入关键词,回车键搜索" class="!w-80" :disabled="loading" @keyup.enter="onSearch" />
<a-checkbox-group v-model="contentTypes" :disabled="loading">
<a-checkbox v-for="item in CONTENT_TYPES" :key="item.value" :value="item.value">
<a-checkbox v-for="item in CONTENT_TYPES.filter((e) => e.value !== CONTENT_TYPE.GAME)" :key="item.value" :value="item.value">
{{ item.label }}
</a-checkbox>
</a-checkbox-group>
Expand Down Expand Up @@ -54,7 +54,7 @@
<script setup lang="tsx">
import { v4 as uuidV4 } from 'uuid';
import pLimit from 'p-limit';
import { CONTENT_TYPES } from '@/constants';
import { CONTENT_TYPES, CONTENT_TYPE } from '@/constants';
import { searchByRuleId } from '@/api';
import { getChapter } from '@/api/vsc';
import { useFavoritesStore } from '@/stores/favorites';
Expand Down
5 changes: 1 addition & 4 deletions packages/web/src/utils/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ export async function request(config: any) {
} else if (PLATFORM === 'electron') {
const { pm } = await import(`./postMessage.electron`);
const method = config.method ?? 'get';
!NProgress.isStarted() && NProgress.start();
const res = await pm.send(`${method}@${config.url}`, config.params || config.data);
NProgress.done();
return res;
return pm.send(`${method}@${config.url}`, config.params || config.data);
} else {
const { pm } = await import(`./postMessage`);
const method = config.method ?? 'get';
Expand Down

0 comments on commit 526232c

Please sign in to comment.