Skip to content

Commit

Permalink
Merge pull request #821 from Hi-Windom/v0.35
Browse files Browse the repository at this point in the history
V0.35
  • Loading branch information
Soltus authored Jun 13, 2024
2 parents 7cd0c21 + bfe12bb commit 94884bf
Show file tree
Hide file tree
Showing 107 changed files with 7,325 additions and 2,448 deletions.
6 changes: 3 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ Install pnpm: `npm install -g [email protected]`

Set the Electron mirror environment variable and install Electron:

* macOS/Linux: `ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ pnpm install [email protected].1 -D`
* macOS/Linux: `ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ pnpm install [email protected].3 -D`
* Windows:
* `SET ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/`
* `pnpm install [email protected].1 -D`
* `pnpm install [email protected].3 -D`

NPM mirror:

Expand All @@ -28,7 +28,7 @@ NPM mirror:

On the desktop, go to the app folder to run:

* `pnpm install [email protected].1 -D`
* `pnpm install [email protected].3 -D`
* `pnpm run dev`
* `pnpm run start`

Expand Down
6 changes: 3 additions & 3 deletions .github/CONTRIBUTING_zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@

* macOS/Linux:
```
ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ pnpm install [email protected].1 -D
ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ pnpm install [email protected].3 -D
```
* Windows:
* `SET ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/`
* `pnpm install [email protected].1 -D`
* `pnpm install [email protected].3 -D`

NPM 镜像:

Expand All @@ -30,7 +30,7 @@ NPM 镜像:

桌面端进入 app 文件夹运行:

* `pnpm install [email protected].1 -D`
* `pnpm install [email protected].3 -D`
* `pnpm run dev`
* `pnpm run start`

Expand Down
4 changes: 2 additions & 2 deletions .vscode/extensions/Sillot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "sillot",
"displayName": "汐洛 Sillot",
"description": "汐洛彖夲肜矩阵(Sillot T☳Converbenk Matrix)为智慧新彖务服务。此插件为汐洛官方插件,提供多功能一体化集成。",
"version": "0.35.2920",
"version": "0.35.24061323",
"preview": true,
"repository": "https://github.com/Hi-Windom/Sillot",
"publisher": "Hi-Windom",
Expand Down Expand Up @@ -459,5 +459,5 @@
"fs-extra": "^11.2.0",
"json5": "^2.2.3"
},
"packageManager": "pnpm@9.2.0"
"packageManager": "pnpm@9.3.0"
}
179 changes: 97 additions & 82 deletions .vscode/extensions/Sillot/src/task/同步更新版本.ts
Original file line number Diff line number Diff line change
@@ -1,82 +1,97 @@
import * as vscode from "vscode";
import fs from "fs-extra";
import path, { resolve } from "path";
import { Log } from "../utils/log";
import { C } from "../extension.const";
import { loadCompletionItemsFromFile } from "../utils/json";

export function add_task_同步更新版本(context: vscode.ExtensionContext) {
const TAG = "汐洛.同步更新版本";
const disposable = vscode.commands.registerCommand(TAG, async () => {
const wname = vscode.workspace.name;
if (wname && vscode.workspace.workspaceFile) {
const pkgMapFile = `${path.dirname(vscode.workspace.workspaceFile.fsPath)}/${C.PackageJsonMapping}`;
Log.d(wname, pkgMapFile);
if (!(await fs.exists(pkgMapFile))) {
vscode.window.showWarningMessage("package.json 映射不存在,请先添加");
return;
}
const pkgMap: { [key: string]: any } = await loadCompletionItemsFromFile(pkgMapFile);
const paths: string[] = pkgMap[wname];

// 创建快速选择框
const quickPick = vscode.window.createQuickPick();
quickPick.title = "选择要更新版本的文件";
quickPick.items = paths.map(path => ({ label: path }));
quickPick.canSelectMany = true; // 允许多选

// 显示快速选择框并等待用户选择
const selectedOptions: string[] = await new Promise(resolve => {
quickPick.onDidAccept(() => {
resolve(quickPick.selectedItems.map(item => item.label));
quickPick.dispose();
});
quickPick.onDidHide(() => {
resolve([]);
quickPick.dispose();
});
quickPick.show();
});

if (selectedOptions.length === 0) {
// 如果用户没有选择任何选项,则直接返回
return;
}

// 获取用户选择的路径的版本号
const versionPromises = selectedOptions.map(async (value: string) => {
if (await fs.exists(value)) {
const pkgContent = fs.readJSONSync(value);
return pkgContent.version;
}
return null; // 如果文件不存在,返回null
});

Promise.all(versionPromises).then(versions => {
// 过滤掉null值
const validVersions = versions.filter(version => version !== null);
vscode.window.showInputBox({ prompt: `输入新版本: (当前版本: ${validVersions.join(", ")})` }).then(async version => {
if (version) {
// 遍历映射并更新版本号
selectedOptions.forEach(async (value: string, index: number) => {
Log.d(TAG, value);
if (await fs.exists(value)) {
const pkgContent = fs.readJSONSync(value);
pkgContent.version = version;
fs.writeFileSync(value, JSON.stringify(pkgContent, null, 2));
Log.d(`${version} ->${value}`);
} else {
vscode.window.showWarningMessage(`已跳过无效映射 ${value}`);
}
});
vscode.window.showInformationMessage("所有 package.json 文件的版本已更新。");
}
});
});
} else {
vscode.window.showWarningMessage("当前不在工作区环境");
}
});

context.subscriptions.push(disposable);
}
import * as vscode from "vscode";
import fs from "fs-extra";
import path, { resolve } from "path";
import { Log } from "../utils/log";
import { C } from "../extension.const";
import { loadCompletionItemsFromFile } from "../utils/json";
import { formatDate } from "sofill/mid";

export function add_task_同步更新版本(context: vscode.ExtensionContext) {
const TAG = "汐洛.同步更新版本";
const disposable = vscode.commands.registerCommand(TAG, async () => {
const wname = vscode.workspace.name;
if (wname && vscode.workspace.workspaceFile) {
const pkgMapFile = `${path.dirname(vscode.workspace.workspaceFile.fsPath)}/${C.PackageJsonMapping}`;
Log.d(wname, pkgMapFile);
if (!(await fs.exists(pkgMapFile))) {
vscode.window.showWarningMessage("package.json 映射不存在,请先添加");
return;
}
const pkgMap: { [key: string]: any } = await loadCompletionItemsFromFile(pkgMapFile);
const paths: string[] = pkgMap[wname];

// 创建快速选择框
const quickPick = vscode.window.createQuickPick();
quickPick.title = "选择要更新版本的文件";
quickPick.items = paths.map(path => ({ label: path }));
quickPick.canSelectMany = true; // 允许多选

// 显示快速选择框并等待用户选择
const selectedOptions: string[] = await new Promise(resolve => {
quickPick.onDidAccept(() => {
resolve(quickPick.selectedItems.map(item => item.label));
quickPick.dispose();
});
quickPick.onDidHide(() => {
resolve([]);
quickPick.dispose();
});
quickPick.show();
});

if (selectedOptions.length === 0) {
// 如果用户没有选择任何选项,则直接返回
return;
}

// 获取用户选择的路径的版本号
const versionPromises = selectedOptions.map(async (value: string) => {
if (await fs.exists(value)) {
const pkgContent = fs.readJSONSync(value);
return pkgContent.version;
}
return null; // 如果文件不存在,返回null
});

Promise.all(versionPromises).then(versions => {
// 过滤掉null值
const validVersions = versions.filter(version => version !== null);
vscode.window
.showInputBox({
title: "请输入新版本号",
value: validVersions[0],
placeHolder: "如果是二段版本号会被使用格式化时间填充为三段版本号",
prompt: `旧版本号: ${validVersions.join(", ")})`,
})
.then(async version => {
if (version) {
// 检查 version 是否只有两段
const versionParts = version.split(".");
if (versionParts.length === 2) {
// 使用当前时间生成第三段版本号
const timestamp = formatDate(new Date(), "yyMMddHH");
version = `${version}.${timestamp}`;
}
// 遍历映射并更新版本号
selectedOptions.forEach(async (value: string, index: number) => {
Log.d(TAG, value);
if (await fs.exists(value)) {
const pkgContent = fs.readJSONSync(value);
pkgContent.version = version;
fs.writeFileSync(value, JSON.stringify(pkgContent, null, 2));
Log.d(`${version} ->${value}`);
} else {
vscode.window.showWarningMessage(`已跳过无效映射 ${value}`);
}
});
vscode.window.showInformationMessage("所有 package.json 文件的版本已更新。");
}
});
});
} else {
vscode.window.showWarningMessage("当前不在工作区环境");
}
});

context.subscriptions.push(disposable);
}
21 changes: 12 additions & 9 deletions .vscode/extensions/Sillot/src/task/添加并推送Git_Tag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as path from "path";
import fs from "fs-extra";
import { formatDate } from "sofill/mid";
import { readJSONFile } from "../utils/json";
import { C } from "../extension.const";

export async function add_task_添加并推送Git_Tag(context: vscode.ExtensionContext) {
const TAG = "汐洛.添加并推送Git_Tag";
Expand Down Expand Up @@ -31,9 +32,11 @@ export async function add_task_添加并推送Git_Tag(context: vscode.ExtensionC
currentPanel.reveal(columnToShowIn);
} else {
// Otherwise, create a new panel
const extensionVersion = vscode.extensions.getExtension(C.extensionId)?.packageJSON.version;
currentPanel = showCustomModal(
TAG,
/*html*/ `<h2>${TAG}</h2>
<h3>当前 webview 载体扩展版本:${extensionVersion}</h3>
<h3>目标 git 本地仓库:${selectedProject}</h3>
<input id="git_tag" placeholder="请输入 git tag" oninput="checkInput(this)"/><span class="error-message"></span><br>
<textarea id="git_tag_description" data-vscode-context='{"webviewSection": "editor", "preventDefaultContextMenuItems": true}' placeholder="描述(可选)"></textarea><br>
Expand All @@ -54,20 +57,20 @@ export async function add_task_添加并推送Git_Tag(context: vscode.ExtensionC
let illegalCharMessage = "疑似输入非法字符: ";
for (let char of illegalChars) {
if (value.includes(char)) {
hasIllegalChar = true;
illegalCharMessage += char + " ";
}
if (value.includes(char)) {
hasIllegalChar = true;
illegalCharMessage += char + " ";
}
}
const messageElement = inputElement.nextElementSibling;
if (hasIllegalChar) {
inputElement.classList.add('error-input');
messageElement.textContent = illegalCharMessage;
} else {
inputElement.classList.remove('error-input');
messageElement.textContent = "";
inputElement.classList.add('error-input');
messageElement.textContent = illegalCharMessage;
} else {
inputElement.classList.remove('error-input');
messageElement.textContent = "";
}
}
</script>
Expand Down
20 changes: 10 additions & 10 deletions app/appearance/.gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
themes/*/custom.css
themes/*
!themes/daylight/
!themes/midnight/
!themes/_lnco/

icons/
!icons/ant/
!icons/material/
!icons/index.html
themes/*/custom.css
themes/*
!themes/daylight/
!themes/midnight/
!themes/lnco/

icons/
!icons/ant/
!icons/material/
!icons/index.html
13 changes: 13 additions & 0 deletions app/appearance/langs/en_US.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
{
"publish": "Publish",
"publishService": "Publish service",
"publishServiceNotStarted": "Publish Service Not Started",
"publishServiceTip": "When enabled, the publish service will be started. This service publishes the content of the current workspace in read-only mode on the local network.",
"publishServicePort": "Service port",
"publishServicePortTip": "Enable the publish service using the specified port number. If set to <code class='fn__code'>0</code>, a random port will be used.",
"publishServiceAddresses": "Service access addresses",
"publishServiceAddressesTip": "Possible network addresses to access the publish service.",
"publishServiceAuth": "Service basic authentication",
"publishServiceAuthTip": "When enabled, authentication is required to access the publish service.",
"publishServiceAuthAccounts": "Authenticated accounts",
"publishServiceAuthAccountsTip": "List of Basic authentication accounts. Visitors need to enter the username and password from this list to view the published content.",
"publishServiceAuthAccountAdd": "Add account",
"copyMirror": "Copy mirror",
"duplicateMirror": "Duplicate mirror",
"duplicateCompletely": "Duplicate completely",
Expand Down
13 changes: 13 additions & 0 deletions app/appearance/langs/es_ES.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
{
"publish": "Publicar",
"publishService": "Publicar servicio",
"publishServiceNotStarted": "Servicio de publicación no iniciado",
"publishServiceTip": "Al activar esto, se iniciará el servicio de publicación. Este servicio publicará el contenido del espacio de trabajo actual en modo de solo lectura en la LAN",
"publishServicePort": "Número de puerto del servicio",
"publishServicePortTip": "Activar el servicio de publicación con el número de puerto especificado. Si se establece en 0, se utilizará un puerto aleatorio",
"publishServiceAddresses": "Direcciones de acceso al servicio",
"publishServiceAddressesTip": "Direcciones de red desde las que se puede acceder al servicio de publicación",
"publishServiceAuth": "Autenticación básica del servicio",
"publishServiceAuthTip": "Al activar esto, se requerirá autenticación al acceder al servicio de publicación",
"publishServiceAuthAccounts": "Cuentas de autenticación",
"publishServiceAuthAccountsTip": "Lista de cuentas de autenticación básica. Después de activar la autenticación básica, los visitantes deberán ingresar el nombre de usuario y la contraseña de la lista para ver el contenido publicado",
"publishServiceAuthAccountAdd": "Agregar cuenta",
"copyMirror": "Copiar espejo",
"duplicateMirror": "Espejo duplicado",
"duplicateCompletely": "Duplicar completamente",
Expand Down
13 changes: 13 additions & 0 deletions app/appearance/langs/fr_FR.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
{
"publish": "Publier",
"publishService": "Publier le service",
"publishServiceNotStarted": "Service de publication non démarré",
"publishServiceTip": "Lorsqu'activé, le service de publication démarre. Ce service publie en mode lecture seule le contenu de l'espace de travail actuel dans le réseau local.",
"publishServicePort": "Numéro de port du service",
"publishServicePortTip": "Active le service de publication avec le numéro de port spécifié. Si défini sur 0, un port aléatoire sera utilisé.",
"publishServiceAddresses": "Adresses d'accès au service",
"publishServiceAddressesTip": "Adresses réseau qui peuvent accéder au service de publication",
"publishServiceAuth": "Authentification Basic du service",
"publishServiceAuthTip": "Lorsqu'activé, une authentification est requise pour accéder au service de publication",
"publishServiceAuthAccounts": "Comptes d'authentification",
"publishServiceAuthAccountsTip": "Liste des comptes d'authentification Basic. Lorsque l'authentification Basic est activée, les visiteurs doivent entrer un nom d'utilisateur et un mot de passe figurant dans cette liste pour consulter le contenu publié.",
"publishServiceAuthAccountAdd": "Ajouter un compte",
"copyMirror": "Copier le miroir",
"duplicateMirror": "Miroir en double",
"duplicateCompletely": "Dupliquer complètement",
Expand Down
15 changes: 14 additions & 1 deletion app/appearance/langs/ja_JP.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
{
"publish": "公開する",
"publishService": "サービスを公開",
"publishServiceNotStarted": "サービスが開始されていません",
"publishServiceTip": "有効にすると、サービスを開始します。このサービスは、現在のワークスペースの内容を読み取り専用モードでローカルネットワークに公開します",
"publishServicePort": "サービスポート",
"publishServicePortTip": "指定したポート番号を使用してサービスを有効にします。0に設定するとランダムなポートが使用されます",
"publishServiceAddresses": "サービスアドレス",
"publishServiceAddressesTip": "公開サービスのネットワークアドレスにアクセス可能",
"publishServiceAuth": "サービスの基本認証",
"publishServiceAuthTip": "有効にすると、公開サービスへのアクセス時に認証が必要になります",
"publishServiceAuthAccounts": "認証アカウント",
"publishServiceAuthAccountsTip": "基本認証アカウントのリスト。基本認証を有効にした場合、訪問者はリスト内のユーザー名とパスワードを入力して公開内容を表示することができます",
"publishServiceAuthAccountAdd": "アカウントを追加する",
"copyMirror": "ミラーをコピー",
"duplicateMirror": "ミラーを複製",
"duplicateCompletely": "完全に複製",
Expand Down Expand Up @@ -1523,4 +1536,4 @@
"247": "ファイル [%s] は制限サイズ [%s] を超えているためアップロードされませんでした",
"248": "目標の見出しがコンテナブロック内にあるためドロップできません"
}
}
}
Loading

0 comments on commit 94884bf

Please sign in to comment.