Skip to content

Commit

Permalink
Merge pull request #166 from MakinoharaShoko/dev
Browse files Browse the repository at this point in the history
4.4.5
  • Loading branch information
MakinoharaShoko authored Sep 23, 2023
2 parents 535dd6a + 9141086 commit 260a98c
Show file tree
Hide file tree
Showing 69 changed files with 3,019 additions and 2,488 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/build-terre.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v3
with:
Expand All @@ -31,15 +31,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'
- name: Build Stage 1
run: |
echo "Welcome to build WebGAL Origine, the editor of WebGAL platform."
echo "Welcome to build WebGAL Terre, the editor of WebGAL platform."
# 安装依赖
yarn install --frozen-lockfile
# 清理
Expand Down Expand Up @@ -109,7 +109,7 @@ jobs:
rm -rf assets/templates/WebGAL_Android_Template/.gitattributes
rm -rf assets/templates/WebGAL_Android_Template/app/src/main/assets/webgal/.gitkeep
rm -rf assets/templates/WebGAL_Android_Template/app/src/main/java/com
echo "WebGAL Origine is now ready to be deployed."
echo "WebGAL Terre is now ready to be deployed."
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
Expand All @@ -120,7 +120,7 @@ jobs:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v3
with:
Expand All @@ -140,7 +140,7 @@ jobs:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v3
with:
Expand All @@ -159,7 +159,7 @@ jobs:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v3
with:
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v3
with:
Expand All @@ -33,15 +33,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'
- name: Build Stage 1
run: |
echo "Welcome to build WebGAL Origine, the editor of WebGAL platform."
echo "Welcome to build WebGAL Terre, the editor of WebGAL platform."
# 安装依赖
yarn install --frozen-lockfile
# 清理
Expand Down Expand Up @@ -111,7 +111,7 @@ jobs:
rm -rf assets/templates/WebGAL_Android_Template/.gitattributes
rm -rf assets/templates/WebGAL_Android_Template/app/src/main/assets/webgal/.gitkeep
rm -rf assets/templates/WebGAL_Android_Template/app/src/main/java/com
echo "WebGAL Origine is now ready to be deployed."
echo "WebGAL Terre is now ready to be deployed."
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
Expand All @@ -122,7 +122,7 @@ jobs:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v3
with:
Expand All @@ -142,7 +142,7 @@ jobs:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v3
with:
Expand All @@ -161,7 +161,7 @@ jobs:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v3
with:
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v3
with:
Expand All @@ -35,15 +35,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'
- name: Build Stage 1
run: |
echo "Welcome to build WebGAL Origine, the editor of WebGAL platform."
echo "Welcome to build WebGAL Terre, the editor of WebGAL platform."
# 安装依赖
yarn install --frozen-lockfile
# 清理
Expand Down Expand Up @@ -113,7 +113,7 @@ jobs:
rm -rf assets/templates/WebGAL_Android_Template/.gitattributes
rm -rf assets/templates/WebGAL_Android_Template/app/src/main/assets/webgal/.gitkeep
rm -rf assets/templates/WebGAL_Android_Template/app/src/main/java/com
echo "WebGAL Origine is now ready to be deployed."
echo "WebGAL Terre is now ready to be deployed."
- name: Compress
run: 7z a -tzip WebGAL_Terre_Linux_Arm64.zip release/*
Expand All @@ -127,7 +127,7 @@ jobs:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v3
with:
Expand All @@ -149,7 +149,7 @@ jobs:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v3
with:
Expand All @@ -170,7 +170,7 @@ jobs:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v3
with:
Expand All @@ -193,7 +193,7 @@ jobs:
needs: ['build-linux','build-arm64','build-mac','build-windows','build-windows-nsis']
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Download artifacts
uses: actions/download-artifact@v2
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "webgal-terre",
"version": "4.4.4",
"version": "4.4.5",
"private": true,
"scripts": {
"dev": "concurrently \"yarn dev:terre\" \"yarn dev:origine\" \"yarn dev:start-dev-server\"",
Expand Down
8 changes: 5 additions & 3 deletions packages/WebGAL-electron/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# WebGAL Electron Project
Add electron support for WebGAL and WebGAL Origine.


Add electron support for WebGAL and WebGAL Terre.

### Optional: Add mirror of electron-builder

```
export ELECTRON_BUILDER_BINARIES_MIRROR=https://npmmirror.com/mirrors/electron-builder-binaries/
export ELECTRON_MIRROR="https://npmmirror.com/mirrors/electron/"
```
```
2 changes: 1 addition & 1 deletion packages/origine2/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/src/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
<title>WebGAL Origine</title>
<title>WebGAL Terre</title>
</head>
<body>
<div id="root"></div>
Expand Down
8 changes: 4 additions & 4 deletions packages/origine2/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "webgal-origine-2",
"private": true,
"version": "4.4.4",
"version": "4.4.5",
"license": "MPL-2.0",
"scripts": {
"dev": "vite --host=3000",
"build": "tsc && vite build --base=./",
"build-lowram": "tsc && node --max_old_space_size=512000 ./node_modules/bin/vite build --base=./",
"build": "node version-sync.js && tsc && vite build --base=./",
"build-lowram": "node version-sync.js && tsc && node --max_old_space_size=512000 ./node_modules/bin/vite build --base=./",
"preview": "vite preview",
"lint": "eslint src/** --fix"
},
Expand All @@ -32,7 +32,7 @@
"react-i18next": "^12.2.2",
"react-redux": "^8.0.1",
"sass": "^1.51.0",
"webgal-parser": "^4.4.3"
"webgal-parser": "^4.4.5-fix2"
},
"devDependencies": {
"@types/lodash": "^4.14.182",
Expand Down
14 changes: 6 additions & 8 deletions packages/origine2/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
import "./App.css";
import { logger } from "./utils/logger";
import {logger} from "./utils/logger";
import DashBoard from "./pages/dashboard/DashBoard";
import { Provider } from "react-redux";
import { origineStore } from "./store/origineStore";
import {Provider} from "react-redux";
import {origineStore} from "./store/origineStore";
import Editor from "./pages/editor/Editor";
import { useEffect } from "react";
import {useEffect} from "react";
import "@icon-park/react/styles/index.css";
import axios from "axios";
import { mapLspKindToMonacoKind } from "./pages/editor/TextEditor/convert";
import {mapLspKindToMonacoKind} from "./pages/editor/TextEditor/convert";
import * as monaco from "monaco-editor";
import Translation from "./components/translation/Translation";
import {lspSceneName} from "@/runtime/WG_ORIGINE_RUNTIME";


// 当前要发给 LSP 的场景名称
export const lspSceneName = { value: "" };

function App() {
useEffect(() => {
logger.info("Welcome to WebGAL live editor!");
Expand Down
9 changes: 9 additions & 0 deletions packages/origine2/src/config/info.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export interface Info {
version: string,
buildTime: string,
}

export const __INFO: Info = {
version: '4.4.5',
buildTime: '2023-09-23T05:28:26.398Z',
};
12 changes: 6 additions & 6 deletions packages/origine2/src/hooks/useLanguage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import { setLanguage } from '@/store/statusReducer';

export function getLanguageName(lang: language): string {
switch (lang) {
case language.zhCn:
return 'zhCn';
case language.en:
return 'en';
case language.jp:
return 'jp';
case language.zhCn:
return 'zhCn';
case language.en:
return 'en';
case language.jp:
return 'jp';
}
}

Expand Down
37 changes: 37 additions & 0 deletions packages/origine2/src/hooks/useRelease.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { __INFO } from "@/config/info";
import { useState, useEffect } from "react";

export interface latestRelease {
version: string,
releaseTime: string,
}

export function useRelease() {

const webgalTerreLatestApiUrl = 'https://api.github.com/repos/MakinoharaShoko/WebGAL_Terre/releases/latest';

const [latestRelease, setLatestRelease] = useState<latestRelease>({ version: __INFO.version, releaseTime: __INFO.buildTime });

const getRelease = async () => {
const response = await fetch(webgalTerreLatestApiUrl);
const releasedata = await response.json();
return releasedata;
};

useEffect(() => {
try {
getRelease().then(
releasedata => setLatestRelease(
{
version: releasedata.tag_name,
releaseTime: releasedata.published_at,
}
)
);
} catch (error) {
console.error(error);
}
}, []);

return latestRelease;
};
12 changes: 6 additions & 6 deletions packages/origine2/src/hooks/useVarTrans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ export type IFormat = Record<string, string>;
* @returns 翻译函数, 输入key时会自动添加前缀, "$" 开头则不填加. 输入多个 key 则会返回翻译数组.
*/
export default function useVarTrans(prefix?: string) {
const { t } = useTranslation();
const trans = (key: string, format?: IFormat) => t(key[0] === '$' ? key.slice(1) : prefix + key, format as any);
const { t } = useTranslation();
const trans = (key: string, format?: IFormat) => t(key[0] === '$' ? key.slice(1) : prefix + key, format as any);

function translation<T extends string | [string, ...string[]]>(key: T, format?: IFormat): T {
if (typeof key === 'string') return trans(key, format) as unknown as T;
return key.map(k => trans(k, format)) as unknown as T;
function translation<T extends string | [string, ...string[]]>(key: T, format?: IFormat): T {
if (typeof key === 'string') return trans(key, format) as unknown as T;
return key.map(k => trans(k, format)) as unknown as T;
}

return translation;
return translation;
}
Loading

0 comments on commit 260a98c

Please sign in to comment.