chore: scaffold obsidian-jekyll-publish
Co-Authored-By: Claude
This commit is contained in:
23
esbuild.config.mjs
Normal file
23
esbuild.config.mjs
Normal file
@@ -0,0 +1,23 @@
|
||||
import esbuild from "esbuild";
|
||||
import process from "process";
|
||||
import builtins from "builtin-modules";
|
||||
import { copyFileSync, mkdirSync } from "fs";
|
||||
|
||||
const prod = process.argv[2] === "production";
|
||||
mkdirSync("dist", { recursive: true });
|
||||
for (const f of ["manifest.json", "styles.css"]) copyFileSync(f, `dist/${f}`);
|
||||
|
||||
const ctx = await esbuild.context({
|
||||
entryPoints: ["src/main.ts"],
|
||||
bundle: true,
|
||||
external: ["obsidian", "electron", ...builtins],
|
||||
format: "cjs",
|
||||
target: "es2020",
|
||||
logLevel: "info",
|
||||
sourcemap: prod ? false : "inline",
|
||||
treeShaking: true,
|
||||
outfile: "dist/main.js",
|
||||
platform: "node",
|
||||
});
|
||||
if (prod) { await ctx.rebuild(); process.exit(0); }
|
||||
else { await ctx.watch(); }
|
||||
9
manifest.json
Normal file
9
manifest.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"id": "jekyll-publish",
|
||||
"name": "Jekyll Publish",
|
||||
"version": "0.1.0",
|
||||
"minAppVersion": "1.5.0",
|
||||
"description": "Publish the active note as a Jekyll post (with images) via git.",
|
||||
"author": "Claude",
|
||||
"isDesktopOnly": true
|
||||
}
|
||||
2329
package-lock.json
generated
Normal file
2329
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
28
package.json
Normal file
28
package.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"name": "obsidian-jekyll-publish",
|
||||
"version": "0.1.0",
|
||||
"description": "Publish the active Obsidian note as a Jekyll post (with images) via git.",
|
||||
"main": "dist/main.js",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "node esbuild.config.mjs",
|
||||
"build": "tsc -noEmit -skipLibCheck && node esbuild.config.mjs production",
|
||||
"test": "vitest run",
|
||||
"test:watch": "vitest",
|
||||
"e2e": "bash scripts/e2e.sh"
|
||||
},
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@playwright/test": "^1.60.0",
|
||||
"@types/js-yaml": "^4.0.9",
|
||||
"@types/node": "^20.11.0",
|
||||
"builtin-modules": "^3.3.0",
|
||||
"esbuild": "^0.20.0",
|
||||
"obsidian": "^1.5.7",
|
||||
"typescript": "^5.4.0",
|
||||
"vitest": "^1.4.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"js-yaml": "^4.1.0"
|
||||
}
|
||||
}
|
||||
4
src/_smoke.test.ts
Normal file
4
src/_smoke.test.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import { expect, test } from "vitest";
|
||||
test("vitest harness works", () => {
|
||||
expect(1 + 1).toBe(2);
|
||||
});
|
||||
2
styles.css
Normal file
2
styles.css
Normal file
@@ -0,0 +1,2 @@
|
||||
.jekyll-publish-row { display: flex; gap: 8px; margin-bottom: 6px; }
|
||||
.jekyll-publish-row input { flex: 1; }
|
||||
10
tsconfig.json
Normal file
10
tsconfig.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".", "inlineSourceMap": true, "inlineSources": true,
|
||||
"module": "ESNext", "target": "ES2020", "allowJs": true,
|
||||
"noImplicitAny": true, "moduleResolution": "node", "importHelpers": true,
|
||||
"isolatedModules": true, "strictNullChecks": true, "strict": true,
|
||||
"esModuleInterop": true, "lib": ["DOM", "ES2020"]
|
||||
},
|
||||
"include": ["src/**/*.ts"]
|
||||
}
|
||||
4
vitest.config.ts
Normal file
4
vitest.config.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import { defineConfig } from "vitest/config";
|
||||
export default defineConfig({
|
||||
test: { include: ["src/**/*.test.ts"] },
|
||||
});
|
||||
Reference in New Issue
Block a user