Obsidian Plugin Config

unlisted

by 3C0D

Development and testing environment for obsidian-plugin-config NPM exports and injection system

β˜… 1 starsUpdated 4d ago
View on GitHub

Obsidian Plugin Config

🎯 Injection system for standalone Obsidian plugins.

NPM Version License

Installation

npm install -g obsidian-plugin-config

Update

npm install -g obsidian-plugin-config@latest --force

Usage (global CLI)

# Inject in current plugin directory
obsidian-inject

# Inject by path
obsidian-inject ../my-plugin

# Inject with SASS support (adds esbuild-sass-plugin)
obsidian-inject ../my-plugin --sass

# Verification only (no changes)
obsidian-inject ../my-plugin --dry-run

# Help
obsidian-inject --help

What is injected

  • βœ… Standalone local scripts: esbuild.config.ts, acp.ts, update-version.ts, release.ts, help.ts, utils.ts
  • βœ… package.json: scripts, dependencies, yarn protection
  • βœ… tsconfig.json: modern optimized TypeScript configuration
  • βœ… eslint.config.mts: ESLint flat config
  • βœ… Config files: .editorconfig, .prettierrc, .npmrc, .env, .vscode/settings.json, .vscode/tasks.json
  • βœ… GitHub Actions: release workflow
  • βœ… Traceability: .injection-info.json (version, date)
  • 🎨 SASS support: optional, via --sass flag

Commands available after injection

yarn start          # Install dependencies + start dev
yarn dev            # Development build (watch mode)
yarn build          # Production build
yarn real           # Build + install to real vault
yarn acp            # Add, commit, push
yarn bacp           # Build + add, commit, push
yarn v              # Update version
yarn release        # GitHub release
yarn lint           # ESLint check
yarn lint:fix       # ESLint fix
yarn help           # Full help

SASS Support

obsidian-inject ../my-plugin --sass

What gets added:

  • βœ… esbuild-sass-plugin dependency
  • βœ… Automatic .scss detection (src/styles.scss priority)
  • βœ… CSS cleanup after compilation

Architecture

The plugin becomes 100% standalone after injection:

  • βœ… Scripts integrated locally (no external runtime dependency)
  • βœ… Updatable via re-injection
  • βœ… Yarn protection enforced
  • βœ… Compatible with all Obsidian plugins

Local Development (for contributors)

This repo has two roles:

  1. Injection system β€” templates/ + scripts/inject-*.ts
  2. Snippet development β€” src/ is a local Obsidian plugin used to develop and export reusable code (modals, helpers)

Setup

git clone https://github.com/3C0D/obsidian-plugin-config
cd obsidian-plugin-config
yarn install

Configure vault paths

# Edit .env
TEST_VAULT=C:/path/to/test/vault
REAL_VAULT=C:/path/to/real/vault

Development commands

yarn dev            # Watch mode (test as local plugin)
yarn real           # Install to real vault
yarn lint:fix       # Fix linting issues
yarn update-exports # Regenerate src/index.ts exports

Injection commands (local)

yarn inject-prompt              # Interactive injection
yarn inject-path ../my-plugin   # Direct injection
yarn inject ../my-plugin --sass # With SASS support
yarn check-plugin ../my-plugin  # Dry-run only

Publish workflow

yarn npm-publish    # All-in-one (7 steps):
                    # 0. NPM auth check
                    # 1. Version bump
                    # 2. Update exports
                    # 3. Generate bin/obsidian-inject.js
                    # 4. Verify package
                    # 5. Commit + push
                    # 6. Publish to NPM
                    # 7. Update global CLI (ask, or auto with --auto-update)

yarn acp is only needed for intermediate commits β€” not required before yarn npm-publish.

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.