Obsidian Plugin Config
unlistedby 3C0D
Development and testing environment for obsidian-plugin-config NPM exports and injection system
β
1 starsUpdated 4d ago
Obsidian Plugin Config
π― Injection system for standalone Obsidian plugins.
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
--sassflag
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-plugindependency - β
Automatic
.scssdetection (src/styles.scsspriority) - β 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:
- Injection system β
templates/+scripts/inject-*.ts - 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 acpis only needed for intermediate commits β not required beforeyarn 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.