obsidian-launcher 1.3.3 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -1,20 +1,23 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
- ObsidianLauncher
4
- } from "./chunk-MZRDQQTK.js";
3
+ ObsidianLauncher,
4
+ watchFiles
5
+ } from "./chunk-KPNJCYO4.js";
5
6
 
6
7
  // src/cli.ts
7
8
  import { Command } from "commander";
8
- import _ from "lodash";
9
- import fs from "fs";
10
9
  import path from "path";
11
10
  import fsAsync from "fs/promises";
12
11
  function parsePlugins(plugins = []) {
13
12
  return plugins.map((p) => {
14
13
  if (p.startsWith("id:")) {
15
- return { id: p.slice(3) };
14
+ const [id, version] = p.slice(3).split("=");
15
+ return { id, version };
16
16
  } else if (p.startsWith("repo:")) {
17
- return { repo: p.slice(5) };
17
+ const [repo, version] = p.slice(5).split("=");
18
+ return { repo, version };
19
+ } else if (p.startsWith("path:")) {
20
+ return { path: p.slice(5) };
18
21
  } else {
19
22
  return { path: p };
20
23
  }
@@ -27,66 +30,58 @@ function parseThemes(themes = []) {
27
30
  result = { name: t.slice(5) };
28
31
  } else if (t.startsWith("repo:")) {
29
32
  result = { repo: t.slice(5) };
33
+ } else if (t.startsWith("path:")) {
34
+ result = { path: t.slice(5) };
30
35
  } else {
31
36
  result = { path: t };
32
37
  }
33
38
  return { ...result, enabled: i == themes.length - 1 };
34
39
  });
35
40
  }
36
- function watchFiles(files, func, options) {
37
- const debouncedFunc = _.debounce((curr, prev) => {
38
- if (curr.mtimeMs > prev.mtimeMs || curr.mtimeMs == 0 && prev.mtimeMs != 0) {
39
- func(curr, prev);
40
- }
41
- }, options.debounce);
42
- for (const file of files) {
43
- fs.watchFile(file, { interval: options.interval, persistent: options.persistent }, debouncedFunc);
44
- }
45
- }
46
41
  var collectOpt = (curr, prev) => [...prev ?? [], curr];
47
42
  var versionOptionArgs = [
48
43
  "-v, --version <version>",
49
- "Obsidian version to run",
44
+ "Obsidian app version",
50
45
  "latest"
51
46
  ];
52
47
  var installerOptionArgs = [
53
48
  "-i, --installer <version>",
54
- "Obsidian installer version to run",
55
- "latest"
49
+ "Obsidian installer version",
50
+ "earliest"
56
51
  ];
57
52
  var cacheOptionArgs = [
58
53
  "-c, --cache <cache>",
59
- "Directory to use as the download cache"
54
+ 'Directory to use as the download cache. (default: OBSIDIAN_CACHE env var or ".obsidian-cache")'
60
55
  ];
61
56
  var pluginOptionArgs = [
62
57
  "-p, --plugin <plugin>",
63
- `Plugin to install. Format: "<path>" or "repo:<github-repo>" or "id:<community-id>". Can be repeated.`,
58
+ 'Plugin to install. Format: "<path>" or "repo:<github-repo>" or "id:<community-id>". Can be repeated.',
64
59
  collectOpt
65
60
  ];
66
61
  var themeOptionArgs = [
67
62
  "-t, --theme <plugin>",
68
- `Theme to install. Format: "<path>" or "repo:<github-repo>" or "name:<community-name>". Can be repeated but only last will be enabled.`,
63
+ 'Theme to install. Format: "<path>" or "repo:<github-repo>" or "name:<community-name>". Can be repeated but only last will be enabled.',
69
64
  collectOpt
70
65
  ];
71
66
  var program = new Command("obsidian-launcher");
72
67
  program.command("download").description("Download Obsidian to the cache").option(...cacheOptionArgs).option(...versionOptionArgs).option(...installerOptionArgs).action(async (opts) => {
73
- const launcher = new ObsidianLauncher({ cacheDir: opts.cache });
74
- const [appVersion, installerVersion] = await launcher.resolveVersions(opts.version, opts.installerVersion);
68
+ const launcher = new ObsidianLauncher({ cacheDir: opts.cache, interactive: true });
69
+ const [appVersion, installerVersion] = await launcher.resolveVersion(opts.version, opts.installerVersion);
75
70
  const installerPath = await launcher.downloadInstaller(installerVersion);
76
71
  console.log(`Downloaded Obsidian installer to ${installerPath}`);
77
72
  const appPath = await launcher.downloadApp(appVersion);
78
73
  console.log(`Downloaded Obsidian app to ${appPath}`);
79
74
  });
80
75
  program.command("install").description("Install plugins and themes into an Obsidian vault").argument("<vault>", "Vault to install into").option(...cacheOptionArgs).option(...pluginOptionArgs).option(...themeOptionArgs).action(async (vault, opts) => {
81
- const launcher = new ObsidianLauncher({ cacheDir: opts.cache });
76
+ const launcher = new ObsidianLauncher({ cacheDir: opts.cache, interactive: true });
82
77
  await launcher.installPlugins(vault, parsePlugins(opts.plugin));
83
78
  await launcher.installThemes(vault, parseThemes(opts.theme));
84
79
  console.log(`Installed plugins and themes into ${vault}`);
85
80
  });
86
81
  program.command("launch").summary("Download and launch Obsidian").description(
87
- "Download and launch Obsidian, opening the specified vault.\n\nThe Obsidian instance will have a sandboxed configuration directory. You can use this option to easily plugin behavior on different versions of Obsidian without messing with your system installation of Obsidian.\n\nYou can pass arguments through to the Obsidian executable using\n npx obsidian-launcher ./vault -- --remote-debugging-port=9222"
82
+ "Download and launch Obsidian, opening the specified vault.\n\nThe Obsidian instance will have a sandboxed configuration directory. You can use this command to test plugin behavior on different versions of Obsidian without messing with your system installation of Obsidian.\n\nYou can pass arguments through to the Obsidian executable using\n npx obsidian-launcher ./vault -- --remote-debugging-port=9222"
88
83
  ).argument("[vault]", "Vault to open").argument("[obsidian-args...]", "Arguments to pass to Obsidian").option(...cacheOptionArgs).option(...versionOptionArgs).option(...installerOptionArgs).option(...pluginOptionArgs).option(...themeOptionArgs).option("--copy", "Copy the vault first").action(async (vault, obsidianArgs, opts) => {
89
- const launcher = new ObsidianLauncher({ cacheDir: opts.cache });
84
+ const launcher = new ObsidianLauncher({ cacheDir: opts.cache, interactive: true });
90
85
  const { proc } = await launcher.launch({
91
86
  appVersion: opts.version,
92
87
  installerVersion: opts.installer,
@@ -106,7 +101,7 @@ program.command("launch").summary("Download and launch Obsidian").description(
106
101
  program.command("watch").summary("Launch Obsidian and watch for changes to plugins and themes").description(
107
102
  'Downloads Obsidian and opens a vault, then watches for changes to plugins and themes.\n\nTakes the same arguments as the "launch" command but watches for changes to any local plugins or themes and updates the the vault. Automatically installs "pjeby/hot-reload" so plugins will hot reload as they are updated.'
108
103
  ).argument("[vault]", "Vault to open").argument("[obsidian-args...]", "Arguments to pass to Obsidian").option(...cacheOptionArgs).option(...versionOptionArgs).option(...installerOptionArgs).option(...pluginOptionArgs).option(...themeOptionArgs).option("--copy", "Copy the vault first").action(async (vault, obsidianArgs, opts) => {
109
- const launcher = new ObsidianLauncher({ cacheDir: opts.cache });
104
+ const launcher = new ObsidianLauncher({ cacheDir: opts.cache, interactive: true });
110
105
  const plugins = await launcher.downloadPlugins(parsePlugins(opts.plugin));
111
106
  const themes = await launcher.downloadThemes(parseThemes(opts.theme));
112
107
  const copy = opts.copy ?? false;
@@ -176,7 +171,7 @@ program.command("watch").summary("Launch Obsidian and watch for changes to plugi
176
171
  console.log("Watching for changes to plugins and themes...");
177
172
  await procExit;
178
173
  });
179
- program.command("create-versions-list").summary("Collect Obsidian version information into a single file").description(
174
+ program.command("update-version-list").summary("Collect Obsidian version information into a single file").description(
180
175
  "Collect Obsidian version information into a single file.\n\nThis command is used to collect Obsidian version information in one place including download links, the minimum installer version, and the internal Electron version for every Obsidian release and beta version. This info is available and automatically kept up to date at https://raw.githubusercontent.com/jesse-r-s-hines/wdio-obsidian-service/HEAD/obsidian-versions.json but you can use this command to recreate the file manually if you want."
181
176
  ).argument("dest", "Path to output. If it already exists, it will update the information instead of creating it from scratch.").option(...cacheOptionArgs).option("--max-instances <count>", "Number of parallel Obsidian instances to launch when checking Electron versions", "1").action(async (dest, opts) => {
182
177
  let versionInfos;
@@ -189,9 +184,9 @@ program.command("create-versions-list").summary("Collect Obsidian version inform
189
184
  if (isNaN(maxInstances)) {
190
185
  throw Error(`Invalid number ${opts.maxInstances}`);
191
186
  }
192
- const launcher = new ObsidianLauncher({ cacheDir: opts.cache });
193
- versionInfos = await launcher.updateObsidianVersionInfos(versionInfos, { maxInstances });
194
- fsAsync.writeFile(dest, JSON.stringify(versionInfos, void 0, 4));
187
+ const launcher = new ObsidianLauncher({ cacheDir: opts.cache, interactive: true });
188
+ versionInfos = await launcher.updateVersionList(versionInfos, { maxInstances });
189
+ await fsAsync.writeFile(dest, JSON.stringify(versionInfos, void 0, 4) + "\n");
195
190
  console.log(`Wrote updated version information to ${dest}`);
196
191
  });
197
192
  program.parseAsync().catch((err) => {
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { Command } from 'commander';\nimport _ from \"lodash\";\nimport { ObsidianLauncher } from \"./launcher.js\"\nimport { PluginEntry, ThemeEntry } from \"./types.js\";\nimport fs from \"fs\";\nimport path from \"path\"\nimport fsAsync from \"fs/promises\";\n\n\nfunction parsePlugins(plugins: string[] = []): PluginEntry[] {\n return plugins.map((p: string) => {\n if (p.startsWith(\"id:\")) {\n return {id: p.slice(3)}\n } else if (p.startsWith(\"repo:\")) {\n return {repo: p.slice(5)}\n } else {\n return {path: p}\n }\n })\n}\n\nfunction parseThemes(themes: string[] = []): ThemeEntry[] {\n return themes.map((t: string, i: number) => {\n let result: ThemeEntry\n if (t.startsWith(\"name:\")) {\n result = {name: t.slice(5)}\n } else if (t.startsWith(\"repo:\")) {\n result = {repo: t.slice(5)}\n } else {\n result = {path: t}\n }\n return {...result, enabled: i == themes.length - 1}\n })\n}\n\n/**\n * Watch a list of files, calls func whenever there's an update. Debounced files changes.\n */\nfunction watchFiles(\n files: string[],\n func: (curr: fs.Stats, prev: fs.Stats) => void,\n options: { interval: number, persistent: boolean, debounce: number },\n) {\n const debouncedFunc = _.debounce((curr: fs.Stats, prev: fs.Stats) => {\n if (curr.mtimeMs > prev.mtimeMs || (curr.mtimeMs == 0 && prev.mtimeMs != 0)) {\n func(curr, prev)\n }\n }, options.debounce);\n for (const file of files) {\n fs.watchFile(file, {interval: options.interval, persistent: options.persistent}, debouncedFunc);\n }\n}\n\nconst collectOpt = (curr: string, prev?: string[]) => [...(prev ?? []), curr];\n\nconst versionOptionArgs = [\n '-v, --version <version>',\n \"Obsidian version to run\",\n \"latest\",\n] as const\nconst installerOptionArgs = [\n '-i, --installer <version>',\n \"Obsidian installer version to run\",\n \"latest\",\n] as const\nconst cacheOptionArgs = [\n '-c, --cache <cache>',\n 'Directory to use as the download cache',\n] as const\nconst pluginOptionArgs = [\n '-p, --plugin <plugin>',\n `Plugin to install. Format: \"<path>\" or \"repo:<github-repo>\" or \"id:<community-id>\". Can be repeated.`,\n collectOpt,\n] as const\nconst themeOptionArgs = [\n '-t, --theme <plugin>',\n `Theme to install. Format: \"<path>\" or \"repo:<github-repo>\" or \"name:<community-name>\". Can be repeated but only last will be enabled.`,\n collectOpt,\n] as const\n\nconst program = new Command(\"obsidian-launcher\");\n\nprogram\n .command(\"download\")\n .description(\"Download Obsidian to the cache\")\n .option(...cacheOptionArgs)\n .option(...versionOptionArgs)\n .option(...installerOptionArgs)\n .action(async (opts) => {\n const launcher = new ObsidianLauncher({cacheDir: opts.cache});\n const [appVersion, installerVersion] = await launcher.resolveVersions(opts.version, opts.installerVersion);\n const installerPath = await launcher.downloadInstaller(installerVersion);\n console.log(`Downloaded Obsidian installer to ${installerPath}`)\n const appPath = await launcher.downloadApp(appVersion);\n console.log(`Downloaded Obsidian app to ${appPath}`)\n })\n\nprogram\n .command(\"install\")\n .description(\"Install plugins and themes into an Obsidian vault\")\n .argument('<vault>', 'Vault to install into')\n .option(...cacheOptionArgs)\n .option(...pluginOptionArgs)\n .option(...themeOptionArgs)\n .action(async (vault, opts) => {\n const launcher = new ObsidianLauncher({cacheDir: opts.cache});\n await launcher.installPlugins(vault, parsePlugins(opts.plugin));\n await launcher.installThemes(vault, parseThemes(opts.theme));\n console.log(`Installed plugins and themes into ${vault}`)\n })\n\n\nprogram\n .command(\"launch\")\n .summary(\"Download and launch Obsidian\")\n .description(\n \"Download and launch Obsidian, opening the specified vault.\\n\" +\n \"\\n\" +\n \"The Obsidian instance will have a sandboxed configuration directory. You can use this option to easily \" +\n \"plugin behavior on different versions of Obsidian without messing with your system installation of \" + \n \"Obsidian.\\n\" +\n \"\\n\" +\n \"You can pass arguments through to the Obsidian executable using\\n\" +\n \" npx obsidian-launcher ./vault -- --remote-debugging-port=9222\"\n )\n .argument('[vault]', 'Vault to open')\n .argument('[obsidian-args...]', 'Arguments to pass to Obsidian')\n .option(...cacheOptionArgs)\n .option(...versionOptionArgs)\n .option(...installerOptionArgs)\n .option(...pluginOptionArgs)\n .option(...themeOptionArgs)\n .option('--copy', \"Copy the vault first\")\n .action(async (vault: string|undefined, obsidianArgs: string[], opts: any) => {\n const launcher = new ObsidianLauncher({cacheDir: opts.cache});\n const {proc} = await launcher.launch({\n appVersion: opts.version, installerVersion: opts.installer,\n vault: vault,\n copy: opts.copy ?? false,\n args: obsidianArgs,\n plugins: parsePlugins(opts.plugin),\n themes: parseThemes(opts.theme),\n spawnOptions: {\n detached: true,\n stdio: 'ignore',\n }\n })\n proc.unref() // Allow node to exit and leave proc running\n console.log(`Launched obsidian ${opts.version}`)\n })\n\nprogram\n .command(\"watch\")\n .summary(\"Launch Obsidian and watch for changes to plugins and themes\")\n .description(\n \"Downloads Obsidian and opens a vault, then watches for changes to plugins and themes.\\n\" +\n \"\\n\" +\n 'Takes the same arguments as the \"launch\" command but watches for changes to any local plugins or themes and ' +\n 'updates the the vault. Automatically installs \"pjeby/hot-reload\" so plugins will hot reload as they are ' +\n 'updated.'\n )\n .argument('[vault]', 'Vault to open')\n .argument('[obsidian-args...]', 'Arguments to pass to Obsidian')\n .option(...cacheOptionArgs)\n .option(...versionOptionArgs)\n .option(...installerOptionArgs)\n .option(...pluginOptionArgs)\n .option(...themeOptionArgs)\n .option('--copy', \"Copy the vault first\")\n .action(async (vault: string, obsidianArgs: string[], opts: any) => {\n const launcher = new ObsidianLauncher({cacheDir: opts.cache});\n // Normalize the plugins and themes\n const plugins = await launcher.downloadPlugins(parsePlugins(opts.plugin));\n const themes = await launcher.downloadThemes(parseThemes(opts.theme));\n const copy: boolean = opts.copy ?? false;\n const launchArgs = {\n appVersion: opts.version, installerVersion: opts.installer,\n vault: vault,\n copy: copy,\n args: obsidianArgs,\n plugins: plugins,\n themes: themes,\n } as const\n\n const {proc, configDir, vault: vaultCopy} = await launcher.launch({\n ...launchArgs,\n plugins: [...plugins, {repo: \"pjeby/hot-reload\"}],\n spawnOptions: {\n detached: false,\n stdio: \"pipe\",\n }\n })\n if (copy) {\n console.log(`Vault copied to ${vaultCopy}`);\n }\n proc.stdout!.on('data', data => console.log(`obsidian: ${data}`));\n proc.stderr!.on('data', data => console.log(`obsidian: ${data}`));\n const procExit = new Promise<number>((resolve) => proc.on('exit', (code) => resolve(code ?? -1)));\n\n for (const plugin of plugins) {\n if (plugin.originalType == \"local\") {\n watchFiles(\n [\"manifest.json\", \"main.js\", \"styles.css\", \"data.json\"].map(f => path.join(plugin.path, f)),\n async () => {\n console.log(`Detected change to \"${plugin.id}\"`);\n try {\n await launcher.installPlugins(vaultCopy!, [plugin]);\n } catch (e) {\n console.error(`Failed to update plugin \"${plugin.id}\": ${e}`)\n }\n },\n {interval: 500, persistent: false, debounce: 1000},\n )\n }\n }\n for (const theme of themes) {\n if (theme.originalType == \"local\") {\n watchFiles(\n [\"manifest.json\", \"theme.css\"].map(f => path.join(theme.path, f)),\n async () => {\n console.log(`Detected change to \"${theme.name}\"`);\n try {\n await launcher.installThemes(vaultCopy!, [theme]);\n } catch (e) {\n console.error(`Failed to update theme \"${theme.name}\": ${e}`)\n }\n },\n {interval: 500, persistent: false, debounce: 1000},\n )\n }\n }\n\n const cleanup = async () => {\n proc.kill(\"SIGTERM\");\n await procExit;\n await fsAsync.rm(configDir, {recursive: true, force: true});\n process.exit(1);\n }\n process.on('SIGINT', cleanup);\n process.on('exit', cleanup);\n\n console.log(\"Watching for changes to plugins and themes...\")\n await procExit;\n })\n\nprogram\n .command(\"create-versions-list\")\n .summary(\"Collect Obsidian version information into a single file\")\n .description(\n \"Collect Obsidian version information into a single file.\\n\" +\n \"\\n\" +\n \"This command is used to collect Obsidian version information in one place including download links, the \" +\n \"minimum installer version, and the internal Electron version for every Obsidian release and beta version. \" +\n \"This info is available and automatically kept up to date at \" +\n \"https://raw.githubusercontent.com/jesse-r-s-hines/wdio-obsidian-service/HEAD/obsidian-versions.json \" +\n \"but you can use this command to recreate the file manually if you want.\"\n )\n .argument('dest', 'Path to output. If it already exists, it will update the information instead of creating it from scratch.')\n .option(...cacheOptionArgs)\n .option('--max-instances <count>', \"Number of parallel Obsidian instances to launch when checking Electron versions\", \"1\")\n .action(async (dest, opts) => {\n let versionInfos: any;\n try {\n versionInfos = JSON.parse(await fsAsync.readFile(dest, \"utf-8\"))\n } catch {\n versionInfos = undefined;\n }\n const maxInstances = Number(opts.maxInstances)\n if (isNaN(maxInstances)) {\n throw Error(`Invalid number ${opts.maxInstances}`)\n }\n\n const launcher = new ObsidianLauncher({cacheDir: opts.cache});\n versionInfos = await launcher.updateObsidianVersionInfos(versionInfos, { maxInstances });\n fsAsync.writeFile(dest, JSON.stringify(versionInfos, undefined, 4));\n console.log(`Wrote updated version information to ${dest}`)\n })\n\nprogram\n .parseAsync()\n .catch((err) => {\n console.log(err?.message ?? err.toString())\n process.exit(1);\n });\n"],"mappings":";;;;;;AACA,SAAS,eAAe;AACxB,OAAO,OAAO;AAGd,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,OAAO,aAAa;AAGpB,SAAS,aAAa,UAAoB,CAAC,GAAkB;AACzD,SAAO,QAAQ,IAAI,CAAC,MAAc;AAC9B,QAAI,EAAE,WAAW,KAAK,GAAG;AACrB,aAAO,EAAC,IAAI,EAAE,MAAM,CAAC,EAAC;AAAA,IAC1B,WAAW,EAAE,WAAW,OAAO,GAAG;AAC9B,aAAO,EAAC,MAAM,EAAE,MAAM,CAAC,EAAC;AAAA,IAC5B,OAAO;AACH,aAAO,EAAC,MAAM,EAAC;AAAA,IACnB;AAAA,EACJ,CAAC;AACL;AAEA,SAAS,YAAY,SAAmB,CAAC,GAAiB;AACtD,SAAO,OAAO,IAAI,CAAC,GAAW,MAAc;AACxC,QAAI;AACJ,QAAI,EAAE,WAAW,OAAO,GAAG;AACvB,eAAS,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ACN,UAAM,QAAQ,GAAG,WAAW,EAAC,WAAW,MAAM,OAAO,KAAI,CAAC;AAC1D,YAAQ,KAAK,CAAC;AAAA,EAClB;AACA,UAAQ,GAAG,UAAU,OAAO;AAC5B,UAAQ,GAAG,QAAQ,OAAO;AAE1B,UAAQ,IAAI,+CAA+C;AAC3D,QAAM;AACV,CAAC;AAEL,QACK,QAAQ,sBAAsB,EAC9B,QAAQ,yDAAyD,EACjE;AAAA,EACG;AAOJ,EACC,SAAS,QAAQ,2GAA2G,EAC5H,OAAO,GAAG,eAAe,EACzB,OAAO,2BAA2B,mFAAmF,GAAG,EACxH,OAAO,OAAO,MAAM,SAAS;AAC1B,MAAI;AACJ,MAAI;AACA,mBAAe,KAAK,MAAM,MAAM,QAAQ,SAAS,MAAM,OAAO,CAAC;AAAA,EACnE,QAAQ;AACJ,mBAAe;AAAA,EACnB;AACA,QAAM,eAAe,OAAO,KAAK,YAAY;AAC7C,MAAI,MAAM,YAAY,GAAG;AACrB,UAAM,MAAM,kBAAkB,KAAK,YAAY,EAAE;AAAA,EACrD;AAEA,QAAM,WAAW,IAAI,iBAAiB,EAAC,UAAU,KAAK,MAAK,CAAC;AAC5D,iBAAe,MAAM,SAAS,2BAA2B,cAAc,EAAE,aAAa,CAAC;AACvF,UAAQ,UAAU,MAAM,KAAK,UAAU,cAAc,QAAW,CAAC,CAAC;AAClE,UAAQ,IAAI,wCAAwC,IAAI,EAAE;AAC9D,CAAC;AAEL,QACK,WAAW,EACX,MAAM,CAAC,QAAQ;AACZ,UAAQ,IAAI,KAAK,WAAW,IAAI,SAAS,CAAC;AAC1C,UAAQ,KAAK,CAAC;AAClB,CAAC;","names":[]}
1
+ {"version":3,"sources":["../src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { Command } from 'commander';\nimport _ from \"lodash\";\nimport { ObsidianLauncher } from \"./launcher.js\"\nimport { watchFiles } from './utils.js';\nimport { PluginEntry, ThemeEntry } from \"./types.js\";\nimport path from \"path\"\nimport fsAsync from \"fs/promises\";\n\n\nfunction parsePlugins(plugins: string[] = []): PluginEntry[] {\n return plugins.map((p: string) => {\n if (p.startsWith(\"id:\")) {\n const [id, version] = p.slice(3).split('=');\n return {id, version};\n } else if (p.startsWith(\"repo:\")) {\n const [repo, version] = p.slice(5).split('=');\n return {repo, version};\n } else if (p.startsWith(\"path:\")) {\n return {path: p.slice(5)};\n } else {\n return {path: p};\n }\n })\n}\n\nfunction parseThemes(themes: string[] = []): ThemeEntry[] {\n return themes.map((t: string, i: number) => {\n let result: ThemeEntry\n if (t.startsWith(\"name:\")) {\n result = {name: t.slice(5)};\n } else if (t.startsWith(\"repo:\")) {\n result = {repo: t.slice(5)};\n } else if (t.startsWith(\"path:\")) {\n result = {path: t.slice(5)};\n } else {\n result = {path: t};\n }\n return {...result, enabled: i == themes.length - 1}\n })\n}\n\nconst collectOpt = (curr: string, prev?: string[]) => [...(prev ?? []), curr];\n\nconst versionOptionArgs = [\n '-v, --version <version>',\n \"Obsidian app version\",\n \"latest\",\n] as const\nconst installerOptionArgs = [\n '-i, --installer <version>',\n \"Obsidian installer version\",\n \"earliest\",\n] as const\nconst cacheOptionArgs = [\n '-c, --cache <cache>',\n 'Directory to use as the download cache. (default: OBSIDIAN_CACHE env var or \".obsidian-cache\")',\n] as const\nconst pluginOptionArgs = [\n '-p, --plugin <plugin>',\n 'Plugin to install. Format: \"<path>\" or \"repo:<github-repo>\" or \"id:<community-id>\". Can be repeated.',\n collectOpt,\n] as const\nconst themeOptionArgs = [\n '-t, --theme <plugin>',\n 'Theme to install. Format: \"<path>\" or \"repo:<github-repo>\" or \"name:<community-name>\". Can be repeated but only last will be enabled.',\n collectOpt,\n] as const\n\nconst program = new Command(\"obsidian-launcher\");\n\nprogram\n .command(\"download\")\n .description(\"Download Obsidian to the cache\")\n .option(...cacheOptionArgs)\n .option(...versionOptionArgs)\n .option(...installerOptionArgs)\n .action(async (opts) => {\n const launcher = new ObsidianLauncher({cacheDir: opts.cache, interactive: true});\n const [appVersion, installerVersion] = await launcher.resolveVersion(opts.version, opts.installerVersion);\n const installerPath = await launcher.downloadInstaller(installerVersion);\n console.log(`Downloaded Obsidian installer to ${installerPath}`)\n const appPath = await launcher.downloadApp(appVersion);\n console.log(`Downloaded Obsidian app to ${appPath}`)\n })\n\nprogram\n .command(\"install\")\n .description(\"Install plugins and themes into an Obsidian vault\")\n .argument('<vault>', 'Vault to install into')\n .option(...cacheOptionArgs)\n .option(...pluginOptionArgs)\n .option(...themeOptionArgs)\n .action(async (vault, opts) => {\n const launcher = new ObsidianLauncher({cacheDir: opts.cache, interactive: true});\n await launcher.installPlugins(vault, parsePlugins(opts.plugin));\n await launcher.installThemes(vault, parseThemes(opts.theme));\n console.log(`Installed plugins and themes into ${vault}`)\n })\n\n\nprogram\n .command(\"launch\")\n .summary(\"Download and launch Obsidian\")\n .description(\n \"Download and launch Obsidian, opening the specified vault.\\n\" +\n \"\\n\" +\n \"The Obsidian instance will have a sandboxed configuration directory. You can use this command to test \" +\n \"plugin behavior on different versions of Obsidian without messing with your system installation of \" + \n \"Obsidian.\\n\" +\n \"\\n\" +\n \"You can pass arguments through to the Obsidian executable using\\n\" +\n \" npx obsidian-launcher ./vault -- --remote-debugging-port=9222\"\n )\n .argument('[vault]', 'Vault to open')\n .argument('[obsidian-args...]', 'Arguments to pass to Obsidian')\n .option(...cacheOptionArgs)\n .option(...versionOptionArgs)\n .option(...installerOptionArgs)\n .option(...pluginOptionArgs)\n .option(...themeOptionArgs)\n .option('--copy', \"Copy the vault first\")\n .action(async (vault: string|undefined, obsidianArgs: string[], opts: any) => {\n const launcher = new ObsidianLauncher({cacheDir: opts.cache, interactive: true});\n const {proc} = await launcher.launch({\n appVersion: opts.version, installerVersion: opts.installer,\n vault: vault,\n copy: opts.copy ?? false,\n args: obsidianArgs,\n plugins: parsePlugins(opts.plugin),\n themes: parseThemes(opts.theme),\n spawnOptions: {\n detached: true,\n stdio: 'ignore',\n }\n })\n proc.unref() // Allow node to exit and leave proc running\n console.log(`Launched obsidian ${opts.version}`)\n })\n\nprogram\n .command(\"watch\")\n .summary(\"Launch Obsidian and watch for changes to plugins and themes\")\n .description(\n \"Downloads Obsidian and opens a vault, then watches for changes to plugins and themes.\\n\" +\n \"\\n\" +\n 'Takes the same arguments as the \"launch\" command but watches for changes to any local plugins or themes and ' +\n 'updates the the vault. Automatically installs \"pjeby/hot-reload\" so plugins will hot reload as they are ' +\n 'updated.'\n )\n .argument('[vault]', 'Vault to open')\n .argument('[obsidian-args...]', 'Arguments to pass to Obsidian')\n .option(...cacheOptionArgs)\n .option(...versionOptionArgs)\n .option(...installerOptionArgs)\n .option(...pluginOptionArgs)\n .option(...themeOptionArgs)\n .option('--copy', \"Copy the vault first\")\n .action(async (vault: string, obsidianArgs: string[], opts: any) => {\n const launcher = new ObsidianLauncher({cacheDir: opts.cache, interactive: true});\n // Normalize the plugins and themes\n const plugins = await launcher.downloadPlugins(parsePlugins(opts.plugin));\n const themes = await launcher.downloadThemes(parseThemes(opts.theme));\n const copy: boolean = opts.copy ?? false;\n const launchArgs = {\n appVersion: opts.version, installerVersion: opts.installer,\n vault: vault,\n copy: copy,\n args: obsidianArgs,\n plugins: plugins,\n themes: themes,\n } as const\n\n const {proc, configDir, vault: vaultCopy} = await launcher.launch({\n ...launchArgs,\n plugins: [...plugins, {repo: \"pjeby/hot-reload\"}],\n spawnOptions: {\n detached: false,\n stdio: \"pipe\",\n }\n })\n if (copy) {\n console.log(`Vault copied to ${vaultCopy}`);\n }\n proc.stdout!.on('data', data => console.log(`obsidian: ${data}`));\n proc.stderr!.on('data', data => console.log(`obsidian: ${data}`));\n const procExit = new Promise<number>((resolve) => proc.on('exit', (code) => resolve(code ?? -1)));\n\n for (const plugin of plugins) {\n if (plugin.originalType == \"local\") {\n watchFiles(\n [\"manifest.json\", \"main.js\", \"styles.css\", \"data.json\"].map(f => path.join(plugin.path, f)),\n async () => {\n console.log(`Detected change to \"${plugin.id}\"`);\n try {\n await launcher.installPlugins(vaultCopy!, [plugin]);\n } catch (e) {\n console.error(`Failed to update plugin \"${plugin.id}\": ${e}`)\n }\n },\n {interval: 500, persistent: false, debounce: 1000},\n )\n }\n }\n for (const theme of themes) {\n if (theme.originalType == \"local\") {\n watchFiles(\n [\"manifest.json\", \"theme.css\"].map(f => path.join(theme.path, f)),\n async () => {\n console.log(`Detected change to \"${theme.name}\"`);\n try {\n await launcher.installThemes(vaultCopy!, [theme]);\n } catch (e) {\n console.error(`Failed to update theme \"${theme.name}\": ${e}`)\n }\n },\n {interval: 500, persistent: false, debounce: 1000},\n )\n }\n }\n\n const cleanup = async () => {\n proc.kill(\"SIGTERM\");\n await procExit;\n await fsAsync.rm(configDir, {recursive: true, force: true});\n process.exit(1);\n }\n process.on('SIGINT', cleanup);\n process.on('exit', cleanup);\n\n console.log(\"Watching for changes to plugins and themes...\")\n await procExit;\n })\n\nprogram\n .command(\"update-version-list\")\n .summary(\"Collect Obsidian version information into a single file\")\n .description(\n \"Collect Obsidian version information into a single file.\\n\" +\n \"\\n\" +\n \"This command is used to collect Obsidian version information in one place including download links, the \" +\n \"minimum installer version, and the internal Electron version for every Obsidian release and beta version. \" +\n \"This info is available and automatically kept up to date at \" +\n \"https://raw.githubusercontent.com/jesse-r-s-hines/wdio-obsidian-service/HEAD/obsidian-versions.json \" +\n \"but you can use this command to recreate the file manually if you want.\"\n )\n .argument('dest', 'Path to output. If it already exists, it will update the information instead of creating it from scratch.')\n .option(...cacheOptionArgs)\n .option('--max-instances <count>', \"Number of parallel Obsidian instances to launch when checking Electron versions\", \"1\")\n .action(async (dest, opts) => {\n let versionInfos: any;\n try {\n versionInfos = JSON.parse(await fsAsync.readFile(dest, \"utf-8\"))\n } catch {\n versionInfos = undefined;\n }\n const maxInstances = Number(opts.maxInstances)\n if (isNaN(maxInstances)) {\n throw Error(`Invalid number ${opts.maxInstances}`)\n }\n\n const launcher = new ObsidianLauncher({cacheDir: opts.cache, interactive: true});\n versionInfos = await launcher.updateVersionList(versionInfos, { maxInstances });\n await fsAsync.writeFile(dest, JSON.stringify(versionInfos, undefined, 4) + \"\\n\");\n console.log(`Wrote updated version information to ${dest}`)\n })\n\nprogram\n .parseAsync()\n .catch((err) => {\n console.log(err?.message ?? err.toString())\n process.exit(1);\n });\n"],"mappings":";;;;;;;AACA,SAAS,eAAe;AAKxB,OAAO,UAAU;AACjB,OAAO,aAAa;AAGpB,SAAS,aAAa,UAAoB,CAAC,GAAkB;AACzD,SAAO,QAAQ,IAAI,CAAC,MAAc;AAC9B,QAAI,EAAE,WAAW,KAAK,GAAG;AACrB,YAAM,CAAC,IAAI,OAAO,IAAI,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG;AAC1C,aAAO,EAAC,IAAI,QAAO;AAAA,IACvB,WAAW,EAAE,WAAW,OAAO,GAAG;AAC9B,YAAM,CAAC,MAAM,OAAO,IAAI,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG;AAC5C,aAAO,EAAC,MAAM,QAAO;AAAA,IACzB,WAAW,EAAE,WAAW,OAAO,GAAG;AAC9B,aAAO,EAAC,MAAM,EAAE,MAAM,CAAC,EAAC;AAAA,IAC5B,OAAO;AACH,aAAO,EAAC,MAAM,EAAC;AAAA,IACnB;AAAA,EACJ,CAAC;AACL;AAEA,SAAS,YAAY,SAAmB,CAAC,GAAiB;AACtD,SAAO,OAAO,IAAI,CAAC,GAAW,MAAc;AACxC,QAAI;AACJ,QAAI,EAAE,WAAW,OAAO,GAAG;AACvB,eAAS,EAAC,MAAM,EAAE,MAAM,CAAC,EAAC;AAAA,IAC9B,WAAW,EAAE,WAAW,OAAO,GAAG;AAC9B,eAAS,EAAC,MAAM,EAAE,MAAM,CAAC,EAAC;AAAA,IAC9B,WAAW,EAAE,WAAW,OAAO,GAAG;AAC9B,eAAS,EAAC,MAAM,EAAE,MAAM,CAAC,EAAC;AAAA,IAC9B,OAAO;AACH,eAAS,EAAC,MAAM,EAAC;AAAA,IACrB;AACA,WAAO,EAAC,GAAG,QAAQ,SAAS,KAAK,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A,EACnB;AACA,QAAM,eAAe,OAAO,KAAK,YAAY;AAC7C,MAAI,MAAM,YAAY,GAAG;AACrB,UAAM,MAAM,kBAAkB,KAAK,YAAY,EAAE;AAAA,EACrD;AAEA,QAAM,WAAW,IAAI,iBAAiB,EAAC,UAAU,KAAK,OAAO,aAAa,KAAI,CAAC;AAC/E,iBAAe,MAAM,SAAS,kBAAkB,cAAc,EAAE,aAAa,CAAC;AAC9E,QAAM,QAAQ,UAAU,MAAM,KAAK,UAAU,cAAc,QAAW,CAAC,IAAI,IAAI;AAC/E,UAAQ,IAAI,wCAAwC,IAAI,EAAE;AAC9D,CAAC;AAEL,QACK,WAAW,EACX,MAAM,CAAC,QAAQ;AACZ,UAAQ,IAAI,KAAK,WAAW,IAAI,SAAS,CAAC;AAC1C,UAAQ,KAAK,CAAC;AAClB,CAAC;","names":[]}
package/dist/index.cjs CHANGED
@@ -1,9 +1,10 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkCUFVRSMTcjs = require('./chunk-CUFVRSMT.cjs');
3
+ var _chunkKQZZMJOZcjs = require('./chunk-KQZZMJOZ.cjs');
4
+ require('./chunk-QQJCBP4N.cjs');
4
5
 
5
6
  // src/index.ts
6
- var index_default = _chunkCUFVRSMTcjs.ObsidianLauncher;
7
+ var index_default = _chunkKQZZMJOZcjs.ObsidianLauncher;
7
8
 
8
9
 
9
10
  exports.default = index_default;
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/wdio-obsidian-service/wdio-obsidian-service/packages/obsidian-launcher/dist/index.cjs","../src/index.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B;AACA;ACEA,IAAO,cAAA,EAAQ,kCAAA;ADAf;AACE;AACF,gCAAC","file":"/home/runner/work/wdio-obsidian-service/wdio-obsidian-service/packages/obsidian-launcher/dist/index.cjs","sourcesContent":[null,"/**\n * @module\n * @document ../README.md\n */\nimport { ObsidianLauncher } from \"./launcher.js\"\n\nexport default ObsidianLauncher;\nexport type {\n ObsidianVersionInfos, ObsidianVersionInfo, ObsidianCommunityPlugin, ObsidianCommunityTheme,\n PluginEntry, DownloadedPluginEntry, ThemeEntry, DownloadedThemeEntry,\n} from \"./types.js\";\n"]}
1
+ {"version":3,"sources":["/home/runner/work/wdio-obsidian-service/wdio-obsidian-service/packages/obsidian-launcher/dist/index.cjs","../src/index.ts"],"names":[],"mappings":"AAAA;AACE;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B;AACA;ACCA,IAAO,cAAA,EAAQ,kCAAA;ADCf;AACE;AACF,gCAAC","file":"/home/runner/work/wdio-obsidian-service/wdio-obsidian-service/packages/obsidian-launcher/dist/index.cjs","sourcesContent":[null,"/**\n * @module\n * @document ../README.md\n */\nimport { ObsidianLauncher } from \"./launcher.js\"\n\nexport default ObsidianLauncher;\nexport type {\n ObsidianVersionList, ObsidianVersionInfo, ObsidianInstallerInfo, ObsidianCommunityPlugin, ObsidianCommunityTheme,\n PluginEntry, DownloadedPluginEntry, ThemeEntry, DownloadedThemeEntry,\n} from \"./types.js\";\n"]}