Skip to content

Commit

Permalink
Add obsidian plugin (#6)
Browse files Browse the repository at this point in the history
* Add obsidian plugin

* Add obisidian files to root
  • Loading branch information
geaz authored Nov 1, 2024
1 parent 46f84b1 commit bcc65fb
Show file tree
Hide file tree
Showing 16 changed files with 4,434 additions and 8 deletions.
25 changes: 24 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,27 @@ dist-ssr
*.njsproj
*.sln
*.sw?
*.afpub~lock~
*.afpub~lock~

# vscode
.vscode

# Intellij
*.iml
.idea

# npm
node_modules

# Don't include the compiled main.js file in the repo.
# They should be uploaded to GitHub releases instead.
main.js

# Exclude sourcemaps
*.map

# obsidian
data.json

# Exclude macOS Finder (System Explorer) View States
.DS_Store
10 changes: 10 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"id": "tablora-rasa",
"name": "Tablora Rasa",
"version": "1.0.0",
"minAppVersion": "0.15.0",
"description": "Use the Tablora Rasa Oracle within Obsidian.",
"author": "Geaz",
"authorUrl": "https://github.com/geaz/tablora-rasa",
"isDesktopOnly": false
}
51 changes: 51 additions & 0 deletions obsidian/esbuild.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import esbuild from "esbuild";
import process from "process";
import builtins from "builtin-modules";
import mdx from '@mdx-js/esbuild';

const banner =
`/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/
`;

const prod = (process.argv[2] === "production");

const context = await esbuild.context({
banner: {
js: banner,
},
entryPoints: ["src/main.ts"],
bundle: true,
external: [
"obsidian",
"electron",
"@codemirror/autocomplete",
"@codemirror/collab",
"@codemirror/commands",
"@codemirror/language",
"@codemirror/lint",
"@codemirror/search",
"@codemirror/state",
"@codemirror/view",
"@lezer/common",
"@lezer/highlight",
"@lezer/lr",
...builtins],
format: "cjs",
target: "es2018",
logLevel: "info",
sourcemap: prod ? false : "inline",
treeShaking: true,
outfile: "dist/main.js",
minify: prod,
plugins: [mdx()]
});

if (prod) {
await context.rebuild();
process.exit(0);
} else {
await context.watch();
}
Loading

0 comments on commit bcc65fb

Please sign in to comment.