release: prepare v1.0.0 for community submission

- Change plugin id to live-preview (obsidian not allowed in id)
- Remove settings heading (not needed for single section)
- Use const instead of var in injected script
- Update README installation instructions
- Remove Author section from README files

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
HxGuang 2026-05-13 17:24:11 +08:00
parent 387fbf3aeb
commit 116f33efe7
6 changed files with 8 additions and 11 deletions

View file

@ -3772,7 +3772,7 @@ function getReloadScript(port) {
return `
<script>
(function() {
var socket = new WebSocket('ws://localhost:${port}/live-reload');
const socket = new WebSocket('ws://localhost:${port}/live-reload');
socket.addEventListener('message', function(event) {
if (event.data === 'reload') {
location.reload();
@ -4040,7 +4040,6 @@ var SettingTab = class extends import_obsidian2.PluginSettingTab {
display() {
const { containerEl } = this;
containerEl.empty();
containerEl.createEl("h2", { text: "Live Preview" });
new import_obsidian2.Setting(containerEl).setName("Port").setDesc("Starting port (will auto-increment if busy)").addText(
(text) => text.setValue(String(this.plugin.settings.port)).onChange(async (value) => {
const port = parseInt(value, 10);

View file

@ -1,7 +1,7 @@
{
"id": "obsidian-live-preview",
"id": "live-preview",
"name": "Live Preview",
"version": "1.0.1",
"version": "1.0.0",
"minAppVersion": "0.15.0",
"description": "Live HTML preview with local HTTP server and auto-reload, like VSCode Live Preview.",
"author": "HxGuang",

6
package-lock.json generated
View file

@ -1,11 +1,11 @@
{
"name": "obsidian-live-preview",
"name": "live-preview",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "obsidian-live-preview",
"name": "live-preview",
"version": "1.0.0",
"dependencies": {
"ws": "^8.16.0"
@ -13,7 +13,7 @@
"devDependencies": {
"@types/ws": "^8.5.10",
"esbuild": "^0.19.0",
"obsidian": "latest",
"obsidian": "^1.12.3",
"typescript": "^5.3.0"
}
},

View file

@ -1,5 +1,5 @@
{
"name": "obsidian-live-preview",
"name": "live-preview",
"version": "1.0.0",
"description": "Live HTML preview with local HTTP server and auto-reload for Obsidian",
"main": "main.js",

View file

@ -23,8 +23,6 @@ export class SettingTab extends PluginSettingTab {
const { containerEl } = this;
containerEl.empty();
containerEl.createEl("h2", { text: "Live Preview" });
new Setting(containerEl)
.setName("Port")
.setDesc("Starting port (will auto-increment if busy)")

View file

@ -2,7 +2,7 @@ export function getReloadScript(port: number): string {
return `
<script>
(function() {
var socket = new WebSocket('ws://localhost:${port}/live-reload');
const socket = new WebSocket('ws://localhost:${port}/live-reload');
socket.addEventListener('message', function(event) {
if (event.data === 'reload') {
location.reload();