Skip to content

Commit d8d33c8

Browse files
chore: align infrastructure with plugin template
- check script now includes typecheck - lint/lint:fix use biome check (lint + format) - Generic validate-plugin.ts (reads name from manifest) - Standardized dependabot.yml config - Add release.yml and CI workflows - Standardized .gitignore - authorUrl → github.com/philoserf Amp-Thread-ID: https://ampcode.com/threads/T-019c7936-f8e0-7551-9184-cac57a8c9538 Co-authored-by: Amp <amp@ampcode.com>
1 parent 7883e7a commit d8d33c8

File tree

7 files changed

+93
-44
lines changed

7 files changed

+93
-44
lines changed

.github/dependabot.yml

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,33 @@
11
version: 2
22
updates:
3-
# npm dependencies
4-
- package-ecosystem: "npm"
3+
- package-ecosystem: npm
54
directory: "/"
65
schedule:
7-
interval: "weekly"
8-
day: "monday"
9-
open-pull-requests-limit: 5
10-
labels:
11-
- "dependencies"
6+
interval: weekly
7+
day: monday
8+
time: "03:00"
9+
open-pull-requests-limit: 10
10+
reviewers:
11+
- philoserf
12+
assignees:
13+
- philoserf
1214
commit-message:
13-
prefix: "chore(deps):"
14-
prefix-development: "chore(deps-dev):"
15+
prefix: "chore"
16+
prefix-scope: "deps"
17+
include: "scope"
18+
19+
- package-ecosystem: github-actions
20+
directory: "/"
21+
schedule:
22+
interval: weekly
23+
day: monday
24+
time: "03:00"
25+
open-pull-requests-limit: 10
26+
reviewers:
27+
- philoserf
28+
assignees:
29+
- philoserf
30+
commit-message:
31+
prefix: "chore"
32+
prefix-scope: "ci"
33+
include: "scope"

.github/workflows/main.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
check:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- uses: oven-sh/setup-bun@v2
16+
with:
17+
bun-version: latest
18+
19+
- run: bun install
20+
- run: bun run check

.github/workflows/release.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
14+
- uses: oven-sh/setup-bun@v2
15+
with:
16+
bun-version: latest
17+
18+
- run: |
19+
bun install
20+
bun run build
21+
22+
- name: Create release
23+
uses: softprops/action-gh-release@v2
24+
with:
25+
files: |
26+
main.js
27+
manifest.json
28+
fail_on_unmatched_files: true
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,8 @@ Thumbs.db
2626
# Claude Code
2727
.claude/settings.local.json
2828

29-
# Planning & analysis (local reference only)
29+
# Planning
3030
.planning/
3131

32-
# Obsidian vault files (except plugins we're developing)
32+
# Obsidian vault files
3333
.obsidian/
34-
!.obsidian/plugins/obsidian-metadata-tool/
35-
.obsidian/plugins/obsidian-metadata-tool/data.json
36-
37-
# Test notes (uncomment if you don't want to track them)
38-
# Sample*.md

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
"minAppVersion": "1.0.0",
66
"description": "Automatically generate metadata for your notes using Claude AI",
77
"author": "Mark Ayers",
8-
"authorUrl": "https://github.com/markayers",
8+
"authorUrl": "https://github.com/philoserf",
99
"isDesktopOnly": false
1010
}

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
"scripts": {
88
"dev": "bun run build.ts --watch",
99
"build": "bun run check && bun run build.ts",
10-
"check": "biome check .",
10+
"check": "bun run typecheck && biome check .",
1111
"typecheck": "tsc --noEmit",
12-
"lint": "biome lint .",
13-
"lint:fix": "biome lint --write .",
12+
"lint": "biome check .",
13+
"lint:fix": "biome check --write .",
1414
"format": "biome format --write .",
1515
"format:check": "biome format .",
16+
"test": "bun test",
1617
"validate": "bun run scripts/validate-plugin.ts",
17-
"version": "bun run version-bump.ts",
18-
"prepublishOnly": "bun run validate"
18+
"version": "bun run version-bump.ts"
1919
},
2020
"keywords": [
2121
"obsidian",

scripts/validate-plugin.ts

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,24 @@
11
#!/usr/bin/env bun
22

3-
/**
4-
* Validation script that runs before publishing
5-
* Uses bun's native runtime for fast execution
6-
*/
7-
83
import { readFileSync } from "node:fs";
94
import { $ } from "bun";
105

11-
console.log("🔍 Validating Metadator plugin...\n");
6+
const manifest = JSON.parse(readFileSync("manifest.json", "utf-8"));
7+
console.log(`🔍 Validating ${manifest.name || "plugin"}...\n`);
128

139
let errors = 0;
1410

1511
// Check manifest.json
16-
try {
17-
const manifest = JSON.parse(readFileSync("manifest.json", "utf-8"));
18-
console.log("✓ manifest.json is valid JSON");
19-
20-
if (!manifest.id || !manifest.name || !manifest.version) {
21-
console.error("✗ manifest.json missing required fields");
22-
errors++;
23-
} else {
24-
console.log(` Plugin: ${manifest.name} v${manifest.version}`);
25-
}
26-
} catch (error) {
27-
console.error("✗ manifest.json is invalid:", error);
12+
if (!manifest.id || !manifest.name || !manifest.version) {
13+
console.error("✗ manifest.json missing required fields");
2814
errors++;
15+
} else {
16+
console.log(`✓ manifest.json — ${manifest.name} v${manifest.version}`);
2917
}
3018

3119
// Check package.json version matches manifest
3220
try {
3321
const pkg = JSON.parse(readFileSync("package.json", "utf-8"));
34-
const manifest = JSON.parse(readFileSync("manifest.json", "utf-8"));
35-
3622
if (pkg.version !== manifest.version) {
3723
console.error(
3824
`✗ Version mismatch: package.json (${pkg.version}) != manifest.json (${manifest.version})`,
@@ -56,7 +42,7 @@ if (typecheckResult.exitCode === 0) {
5642
errors++;
5743
}
5844

59-
// Run linter
45+
// Run checks
6046
console.log("\n🔧 Checking code quality...");
6147
const checkResult = await $`bun run check`.nothrow();
6248
if (checkResult.exitCode === 0) {
@@ -72,7 +58,6 @@ const buildResult = await $`bun run build`.nothrow();
7258
if (buildResult.exitCode === 0) {
7359
console.log("✓ Build successful");
7460

75-
// Check if main.js exists
7661
const mainFile = Bun.file("main.js");
7762
if (await mainFile.exists()) {
7863
const size = mainFile.size / 1024;

0 commit comments

Comments
 (0)