Skip to content

Commit

Permalink
feat(settings): Remove unused dependency and settings config.
Browse files Browse the repository at this point in the history
  • Loading branch information
walkthunder committed Jul 6, 2023
1 parent f5e0943 commit f972ead
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 579 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/auto-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm run build2
- run: npm run build
- uses: actions/upload-artifact@v2
with:
name: my-dist
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm run build2
- run: npm run build
- name: Create Release
id: create_release
uses: actions/create-release@v1
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "invio",
"name": "Invio",
"version": "0.1.3",
"version": "0.1.4",
"minAppVersion": "0.13.21",
"description": "Invio is a plugin for Obsidian which lets you export docs as HTML websites / webpages. It is similar to publish, but you get the .html files to your own COS and then you can do whatever you want with. Its goal is to support as many features of obsidian possible including themes, dataview, graph view, and more.",
"author": "frontend-engineering",
Expand Down
10 changes: 3 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
"version": "0.1.3",
"description": "Publish your obsidian docs to COS.",
"scripts": {
"dev2": "node esbuild.config.mjs",
"build2": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production",
"build": "webpack --mode production",
"dev": "webpack --mode development --watch",
"dev": "node esbuild.config.mjs",
"build": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production",
"format": "npx prettier --write .",
"clean": "npx rimraf main.js",
"test": "cross-env TS_NODE_COMPILER_OPTIONS={\\\"module\\\":\\\"commonjs\\\"} mocha -r ts-node/register 'tests/**/*.ts'"
Expand Down Expand Up @@ -51,9 +49,7 @@
"ts-node": "^10.7.0",
"tslib": "2.4.0",
"typescript": "4.7.4",
"webdav-server": "^2.6.2",
"webpack": "^5.72.0",
"webpack-cli": "^4.9.2"
"webdav-server": "^2.6.2"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.81.0",
Expand Down
340 changes: 13 additions & 327 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/langs/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,10 @@
"settings_outputbasepathvaultid": "Output Vault Base Path And Randomly Assigned ID",
"settings_outputbasepathvaultid_desc": "For debugging purposes.",
"settings_outputbasepathvaultid_button": "Output",
"settings_resetcache": "Reset Local Internal Cache/Databases",
"settings_resetcache_desc": "Reset local internal caches/databases (for debugging purposes). You would want to reload the plugin after resetting this. This option will not empty the {s3, password...} settings.",
"settings_resetcache": "Reset Local Syncing Cache",
"settings_resetcache_desc": "Reset local syncing caches data (if syncing went wrong or debug). This option will not delete your local settings like password or other COS config.",
"settings_resetcache_button": "Reset",
"settings_resetcache_notice": "Local internal cache/databases deleted. Please manually reload the plugin.",
"settings_resetcache_notice": "Local syncing cache deleted. Please manually reload the plugin.",

"syncalgov2_title": "Invio has a better sync algorithm",
"syncalgov2_texts": "Welcome to Invio!\nIn addition to your notes, it also requires uploading additional files with metadata (_invio-metadata-on-remote.{json,bin}) to your cloud service COS. By reading this information, another device can determine which files or folders have been deleted on the first device.\nIf you agree with this policy, please click the 'Agree' button and start enjoying this plugin! Please note that before using the plugin, it's important to back up your vault.\nIf you do not agree with this policy, you should stop using this version and any future versions of Invio. After clicking 'Disagree', the plugin will automatically stop running (unload), and you will need to manually disable it in Obsidian settings.\nPlease let me know if there is anything else I can assist you with!",
Expand Down
6 changes: 3 additions & 3 deletions src/langs/zh_cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,10 @@
"settings_outputbasepathvaultid": "输出资料库对应的位置和随机分配的 ID",
"settings_outputbasepathvaultid_desc": "用于调试。",
"settings_outputbasepathvaultid_button": "输出",
"settings_resetcache": "重设本地缓存和数据库",
"settings_resetcache_desc": "(出于调试原因)重设本地缓存和数据库。您需要在重设之后重新载入此插件。本重设不会删除 s3,密码……等设定。",
"settings_resetcache": "清空本地同步缓存数据",
"settings_resetcache_desc": "清除本地同步产生的缓存数据,遇到同步问题或者调试时使用。(不会清除密码等本地配置)",
"settings_resetcache_button": "重设",
"settings_resetcache_notice": "本地同步缓存和数据库已被删除。请手动重新载入此插件",
"settings_resetcache_notice": "本地同步缓存数据已删除。请手动重新加载插件",

"syncalgov2_title": "Invio 的同步算法",
"syncalgov2_texts": "欢迎使用 Invio!\n 除了您的笔记之外,它还需要上传额外的带有元信息的文件 _invio-metadata-on-remote.{json,bin} 到您的云服务COS上。\n通过读取这些信息,另一台设备可以知道什么文件或文件夹在第一台设备上被删除了。\n如果您同意此策略,请点击按钮 \"同意\",然后开始享用此插件!且特别要注意:使用插件之前,请首先备份好您的库(Vault)!\n如果您不同意此策略,您应该停止使用此版本和之后版本的 Invio。点击 \"不同意\" 之后,插件会自动停止运行(unload),然后您需要 Obsidian 设置里手动停用(disable)此插件。",
Expand Down
6 changes: 3 additions & 3 deletions src/langs/zh_tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,10 @@
"settings_outputbasepathvaultid": "輸出資料庫對應的位置和隨機分配的 ID",
"settings_outputbasepathvaultid_desc": "用於除錯。",
"settings_outputbasepathvaultid_button": "輸出",
"settings_resetcache": "重設本地快取和資料庫",
"settings_resetcache_desc": "(出於除錯原因)重設本地快取和資料庫。您需要在重設之後重新載入此外掛。本重設不會刪除 s3,密碼……等設定。",
"settings_resetcache": "清空本地同步缓存数据",
"settings_resetcache_desc": "清除本地同步产生的缓存数据,遇到同步问题或者调试时使用。(不会清除密码等本地配置)",
"settings_resetcache_button": "重設",
"settings_resetcache_notice": "本地同步快取和資料庫已被刪除。請手動重新載入此外掛",
"settings_resetcache_notice": "本地同步数据已刪除。請手動重新載入外掛",

"syncalgov2_title": "Invio 的同步算法",
"syncalgov2_texts": "歡迎使用 Invio!除了您的筆記之外,它還需要上傳額外帶有元資訊的檔案 _invio-metadata-on-remote.{json,bin} 到您的雲服務 COS 上。通過讀取這些資訊,另一台設備可以知道在第一台設備上被刪除了哪些檔案或資料夾。如果您同意此策略,請點擊按鈕 \"同意\",然後開始享用此插件!特別要注意:在使用插件之前,請先好好備份您的庫(Vault)!如果您不同意此策略,您應該停止使用此版本和之後的 Invio。點擊 \"不同意\" 之後,插件會自動停止運行(unload),然後您需要在 Obsidian 設定中手動停用(disable)此插件。",
Expand Down
145 changes: 0 additions & 145 deletions src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -894,151 +894,6 @@ export class InvioSettingTab extends PluginSettingTab {
const debugDiv = containerEl.createEl("div");
debugDiv.createEl("h2", { text: t("settings_debug") });

new Setting(debugDiv)
.setName(t("settings_debuglevel"))
.setDesc(t("settings_debuglevel_desc"))
.addDropdown(async (dropdown) => {
dropdown.addOption("info", "info");
dropdown.addOption("debug", "debug");
dropdown
.setValue(this.plugin.settings.currLogLevel)
.onChange(async (val: string) => {
this.plugin.settings.currLogLevel = val;
log.setLevel(val as any);
await this.plugin.saveSettings();
log.info(`the log level is changed to ${val}`);
});
});

new Setting(debugDiv)
.setName(t("settings_outputsettingsconsole"))
.setDesc(t("settings_outputsettingsconsole_desc"))
.addButton(async (button) => {
button.setButtonText(t("settings_outputsettingsconsole_button"));
button.onClick(async () => {
const c = messyConfigToNormal(await this.plugin.loadData());
log.info(c);
new Notice(t("settings_outputsettingsconsole_notice"));
});
});

new Setting(debugDiv)
.setName(t("settings_syncplans"))
.setDesc(t("settings_syncplans_desc"))
.addButton(async (button) => {
button.setButtonText(t("settings_syncplans_button_json"));
button.onClick(async () => {
await exportVaultSyncPlansToFiles(
this.plugin.db,
this.app.vault,
this.plugin.vaultRandomID,
"json"
);
new Notice(t("settings_syncplans_notice"));
});
})
.addButton(async (button) => {
button.setButtonText(t("settings_syncplans_button_table"));
button.onClick(async () => {
await exportVaultSyncPlansToFiles(
this.plugin.db,
this.app.vault,
this.plugin.vaultRandomID,
"table"
);
new Notice(t("settings_syncplans_notice"));
});
});
new Setting(debugDiv)
.setName(t("settings_delsyncplans"))
.setDesc(t("settings_delsyncplans_desc"))
.addButton(async (button) => {
button.setButtonText(t("settings_delsyncplans_button"));
button.onClick(async () => {
await clearAllSyncPlanRecords(this.plugin.db);
new Notice(t("settings_delsyncplans_notice"));
});
});

new Setting(debugDiv)
.setName(t("settings_logtodb"))
.setDesc(t("settings_logtodb_desc"))
.addDropdown(async (dropdown) => {
dropdown.addOption("enable", t("enable"));
dropdown.addOption("disable", t("disable"));
dropdown
.setValue(this.plugin.settings.logToDB ? "enable" : "disable")
.onChange(async (val: string) => {
const logToDB = val === "enable";
if (logToDB) {
applyLogWriterInplace((...msg: any[]) => {
insertLoggerOutputByVault(
this.plugin.db,
this.plugin.vaultRandomID,
...msg
);
});
} else {
restoreLogWritterInplace();
}
clearExpiredLoggerOutputRecords(this.plugin.db);
this.plugin.settings.logToDB = logToDB;
await this.plugin.saveSettings();
});
});

new Setting(debugDiv)
.setName(t("settings_logtodbexport"))
.setDesc(
t("settings_logtodbexport_desc", {
debugFolder: DEFAULT_DEBUG_FOLDER,
})
)
.addButton(async (button) => {
button.setButtonText(t("settings_logtodbexport_button"));
button.onClick(async () => {
await exportVaultLoggerOutputToFiles(
this.plugin.db,
this.app.vault,
this.plugin.vaultRandomID
);
new Notice(t("settings_logtodbexport_notice"));
});
});

new Setting(debugDiv)
.setName(t("settings_logtodbclear"))
.setDesc(t("settings_logtodbclear_desc"))
.addButton(async (button) => {
button.setButtonText(t("settings_logtodbclear_button"));
button.onClick(async () => {
await clearAllLoggerOutputRecords(this.plugin.db);
new Notice(t("settings_logtodbclear_notice"));
});
});

new Setting(debugDiv)
.setName(t("settings_delsyncmap"))
.setDesc(t("settings_delsyncmap_desc"))
.addButton(async (button) => {
button.setButtonText(t("settings_delsyncmap_button"));
button.onClick(async () => {
await clearAllSyncMetaMapping(this.plugin.db);
new Notice(t("settings_delsyncmap_notice"));
});
});

new Setting(debugDiv)
.setName(t("settings_outputbasepathvaultid"))
.setDesc(t("settings_outputbasepathvaultid_desc"))
.addButton(async (button) => {
button.setButtonText(t("settings_outputbasepathvaultid_button"));
button.onClick(async () => {
new Notice(this.plugin.getVaultBasePath());
new Notice(this.plugin.vaultRandomID);
});
});

new Setting(debugDiv)
.setName(t("settings_resetcache"))
.setDesc(t("settings_resetcache_desc"))
Expand Down
88 changes: 0 additions & 88 deletions webpack.config.js

This file was deleted.

0 comments on commit f972ead

Please sign in to comment.