Skip to content

Commit

Permalink
feat(all): 脚本更新至 4.0 , 软件更新至 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
enncy committed Feb 10, 2023
1 parent 2e388c8 commit 7cb995f
Show file tree
Hide file tree
Showing 167 changed files with 7,016 additions and 3,953 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"cSpell.words": [
"jsdom",
"axios",
"historychange",
"isclose",
"isstop",
Expand All @@ -12,6 +14,7 @@
"onrun",
"Tesseract",
"traineddata",
"webrtc",
"xmlhttp",
"zhihuishu"
],
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
],
"scripts": {
"dev:core": "gulp -f ./scripts/dev-core.js",
"build:core": "pnpm build && gulp -f ./scripts/build-core.js",
"build:app": "pnpm build && gulp -f ./scripts/build-app.js",
"build:core": "gulp -f ./scripts/build-core.js",
"build:app": "gulp -f ./scripts/build-app.js",
"build": "pnpm lint && gulp -f ./scripts/tsc.js",
"lint": "pnpm format && eslint ./packages --ext .ts,.tsx,.js,.jsx,.vue --fix",
"format": "prettier . --write",
Expand Down
140 changes: 140 additions & 0 deletions packages/app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
# customize

pnpm-lock.yaml
package-lock.json
public

# rollup-plugin-visualizer
stats.html


# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
7 changes: 4 additions & 3 deletions packages/app/electron.builder.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
"asar": false,
"copyright": "Copyright © 2021 ${author}",
"nsis": {
"oneClick": true
"oneClick": false,
"allowToChangeInstallationDirectory": true
},
"win": {
"icon": "public/favicon.ico",
"icon": "public/favicon.png",
"artifactName": "${productName}-${version}-setup-${os}-${arch}.${ext}",
"target": [
{
Expand All @@ -21,7 +22,7 @@
]
},
"mac": {
"icon": "public/favicon.ico",
"icon": "public/favicon.icns",
"artifactName": "${productName}-${version}-setup-${os}-${arch}.${ext}",
"target": "default"
}
Expand Down
13 changes: 9 additions & 4 deletions packages/app/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@ import { handleOpenFile } from './src/tasks/handle.open';
import { remoteRegister } from './src/tasks/remote.register';
import { initStore } from './src/tasks/init.store';
import { autoLaunch } from './src/tasks/auto.launch';
import { createWindow } from './src/main';
import { createWindow } from './src/window';
import { globalListenerRegister } from './src/tasks/global.listener';
import { task } from './src/utils';
import { handleError } from './src/tasks/error.handler';
import { updater } from './src/tasks/updater';
import { startupServer } from './src/tasks/startup.server';

// 设置 webrtc 的影像帧率比例,最高100,太高会造成卡顿,默认50
app.commandLine.appendSwitch('webrtc-max-cpu-consumption-percentage', '1');

/** 获取单进程锁 */
const gotTheLock = app.requestSingleInstanceLock();
if (!gotTheLock) {
Expand All @@ -25,10 +28,12 @@ function bootstrap() {
task('OCS启动程序', () =>
Promise.all([
task('初始化错误处理', () => handleError()),
task('初始化本地设置', () => initStore()),
task('初始化本地设置', () => {
initStore();
task('启动接口服务', () => startupServer());
}),
task('初始化自动启动', () => autoLaunch()),
task('处理打开文件', () => handleOpenFile(process.argv)),
task('启动接口服务', () => startupServer()),

task('启动渲染进程', async () => {
await app.whenReady();
Expand All @@ -44,7 +49,6 @@ function bootstrap() {
e.preventDefault();
window.webContents.send('close');
});

task('初始化远程通信模块', () => remoteRegister(window));
task('注册app事件监听器', () => globalListenerRegister(window));

Expand All @@ -55,6 +59,7 @@ function bootstrap() {
window.webContents.openDevTools();
}

window.webContents.setZoomFactor(1);
window.show();

if (app.isPackaged) {
Expand Down
12 changes: 7 additions & 5 deletions packages/app/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"name": "@ocsjs/app",
"version": "1.6.0",
"version": "2.0.0",
"description": "app package of ocs",
"main": "./lib/types.js",
"main": "./lib/index.js",
"types": "./lib/types.d.ts",
"scripts": {
"dev": "tsc && chcp 65001 && electron .",
"dev:mac": "tsc && electron .",
"dev": "tsc && chcp 65001 && electron .",
"dev:mac": "tsc && electron .",
"pack": "tsc && electron-builder --config ./electron.builder.json --dir",
"dist": "tsc && electron-builder --config ./electron.builder.json"
"dist": "tsc && electron-builder --config ./electron.builder.json",
"proxy": "HTTPS_PROXY=127.0.0.1:7890"
},
"devDependencies": {
"@types/adm-zip": "^0.4.34",
Expand All @@ -24,6 +25,7 @@
"adm-zip": "^0.5.9",
"axios": "^0.25.0",
"chalk": "4.1.0",
"chromium": "^3.0.3",
"dayjs": "^1.10.7",
"electron-store": "^8.0.1",
"express": "^4.18.1",
Expand Down
57 changes: 0 additions & 57 deletions packages/app/public/assets/@ant-design.3b2e5a41.js

This file was deleted.

4 changes: 4 additions & 0 deletions packages/app/public/assets/@arco-design.02506a81.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/app/public/assets/@arco-design.53190b4f.css

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions packages/app/public/assets/@babel.15d7ba59.js

This file was deleted.

Loading

0 comments on commit 7cb995f

Please sign in to comment.