obsidian-plugin-config 1.7.1 → 1.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +205 -205
- package/bin/obsidian-inject.js +1 -1
- package/docs/LLM-GUIDE.md +130 -130
- package/package.json +1 -1
- package/scripts/build-npm.ts +393 -393
- package/scripts/help.ts +87 -87
- package/scripts/inject-core.ts +897 -897
- package/scripts/inject-path.ts +156 -156
- package/scripts/inject-prompt.ts +104 -104
- package/scripts/utils.ts +151 -151
- package/tsconfig.json +2 -2
package/README.md
CHANGED
|
@@ -1,205 +1,205 @@
|
|
|
1
|
-
# Obsidian Plugin Config
|
|
2
|
-
|
|
3
|
-
🎯 Global CLI injection tool for Obsidian plugins.
|
|
4
|
-
|
|
5
|
-
[](https://www.npmjs.com/package/obsidian-plugin-config)
|
|
6
|
-
[](LICENSE)
|
|
7
|
-
|
|
8
|
-
## Installation
|
|
9
|
-
|
|
10
|
-
```bash
|
|
11
|
-
npm install -g obsidian-plugin-config
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
## Update
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
npm install -g obsidian-plugin-config@latest --force
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## Usage (global CLI)
|
|
21
|
-
|
|
22
|
-
```bash
|
|
23
|
-
# Inject in current plugin directory
|
|
24
|
-
# Prompts for confirmation before replacing each existing file
|
|
25
|
-
obsidian-inject
|
|
26
|
-
|
|
27
|
-
# Inject by path
|
|
28
|
-
# Prompts for confirmation before replacing each existing file
|
|
29
|
-
obsidian-inject ../my-plugin
|
|
30
|
-
|
|
31
|
-
# Inject without confirmation
|
|
32
|
-
# Auto-confirms all file replacements (no prompts)
|
|
33
|
-
obsidian-inject ../my-plugin --no
|
|
34
|
-
|
|
35
|
-
# Verification only (dry-run)
|
|
36
|
-
# Shows what would be injected without making any changes
|
|
37
|
-
obsidian-inject ../my-plugin --dry-run
|
|
38
|
-
|
|
39
|
-
# Help
|
|
40
|
-
obsidian-inject --help
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
## CLI Options
|
|
44
|
-
|
|
45
|
-
- `--no`, `-n` - Skip confirmation prompts (auto-confirm)
|
|
46
|
-
- `--dry-run` - Verification only (no changes)
|
|
47
|
-
|
|
48
|
-
## What is injected
|
|
49
|
-
|
|
50
|
-
- ✅ **Standalone local scripts**: `esbuild.config.ts`, `acp.ts`,
|
|
51
|
-
`update-version.ts`, `release.ts`, `help.ts`, `utils.ts`
|
|
52
|
-
- ✅ **package.json**: scripts, dependencies, yarn protection
|
|
53
|
-
- ✅ **tsconfig.json**: modern optimized TypeScript configuration
|
|
54
|
-
- ✅ **eslint.config.mts**: ESLint flat config
|
|
55
|
-
- ✅ **Config files**: `.editorconfig`, `.prettierrc`, `.npmrc`,
|
|
56
|
-
`.env`, `.vscode/settings.json`, `.vscode/tasks.json`
|
|
57
|
-
- ✅ **GitHub Actions**: release workflow
|
|
58
|
-
- ✅ **Traceability**: `.injection-info.json` (version, date)
|
|
59
|
-
- 🎨 **SCSS support**: automatic detection in the injected `esbuild.config.ts`
|
|
60
|
-
|
|
61
|
-
## Commands available after injection
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
yarn start # Install dependencies + start dev
|
|
65
|
-
yarn dev # Development build (watch mode)
|
|
66
|
-
yarn build # Production build
|
|
67
|
-
yarn real # Build + install to real vault
|
|
68
|
-
yarn acp # Add, commit, push
|
|
69
|
-
yarn bacp # Build + add, commit, push
|
|
70
|
-
yarn v # Update version
|
|
71
|
-
yarn r # GitHub release
|
|
72
|
-
yarn lint # ESLint check
|
|
73
|
-
yarn lint:fix # ESLint fix
|
|
74
|
-
yarn prettier # Prettier check
|
|
75
|
-
yarn prettier:fix # Prettier format all
|
|
76
|
-
yarn h # Full help
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
## Updating Dependencies
|
|
80
|
-
|
|
81
|
-
```bash
|
|
82
|
-
yarn upgrade # Update all dependencies to latest
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
## SASS Support
|
|
86
|
-
|
|
87
|
-
SCSS is detected automatically by the injected `esbuild.config.ts`:
|
|
88
|
-
|
|
89
|
-
- ✅ Automatic `.scss` detection (`src/styles.scss` priority)
|
|
90
|
-
- ✅ CSS cleanup after compilation
|
|
91
|
-
|
|
92
|
-
If your plugin uses SCSS, install the plugin once:
|
|
93
|
-
|
|
94
|
-
```bash
|
|
95
|
-
yarn add -D esbuild-sass-plugin
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
## Architecture
|
|
99
|
-
|
|
100
|
-
Target plugins become **100% standalone** after injection:
|
|
101
|
-
|
|
102
|
-
- ✅ Scripts integrated locally (no external runtime dependency)
|
|
103
|
-
- ✅ Updatable via re-injection
|
|
104
|
-
- ✅ Yarn protection enforced
|
|
105
|
-
- ✅ Compatible with all Obsidian plugins
|
|
106
|
-
|
|
107
|
-
## Development Workflow (for injected plugins)
|
|
108
|
-
|
|
109
|
-
After injection, your plugin has a complete development setup:
|
|
110
|
-
|
|
111
|
-
### Environment Setup
|
|
112
|
-
|
|
113
|
-
**In-place development** (inside vault):
|
|
114
|
-
- Develop directly in `.obsidian/plugins/your-plugin`
|
|
115
|
-
- Run `yarn dev` - builds automatically to current location
|
|
116
|
-
|
|
117
|
-
**External development** (outside vault):
|
|
118
|
-
- Develop anywhere on your system
|
|
119
|
-
- Configure `.env` file with vault paths:
|
|
120
|
-
```bash
|
|
121
|
-
TEST_VAULT=/path/to/test/vault
|
|
122
|
-
REAL_VAULT=/path/to/production/vault
|
|
123
|
-
```
|
|
124
|
-
- Run `yarn dev` - builds to TEST_VAULT
|
|
125
|
-
- Run `yarn real` - builds to REAL_VAULT
|
|
126
|
-
|
|
127
|
-
### Development Commands
|
|
128
|
-
|
|
129
|
-
```bash
|
|
130
|
-
yarn start # Install dependencies + start dev
|
|
131
|
-
yarn dev # Watch mode (auto-rebuild on changes)
|
|
132
|
-
yarn build # Production build
|
|
133
|
-
yarn real # Build to production vault
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
### VSCode Tasks (Ctrl+Shift+P → "Run Task")
|
|
137
|
-
|
|
138
|
-
After injection, VSCode tasks are available for quick access:
|
|
139
|
-
|
|
140
|
-
- **Build** - Production build
|
|
141
|
-
- **Lint** / **Lint: Fix** - ESLint check/fix
|
|
142
|
-
- **Prettier: Check** / **Prettier: Fix** - Format check/fix
|
|
143
|
-
- **Obsidian Inject** - Re-inject configuration (with confirmation)
|
|
144
|
-
- **Obsidian Inject (no confirm)** - Re-inject without confirmation
|
|
145
|
-
- **Cleanup: Lint + Prettier + Build** - Full cleanup sequence
|
|
146
|
-
|
|
147
|
-
💡 **Tip**: Use `Ctrl+Shift+B` (Windows/Linux) or `Cmd+Shift+B` (Mac) for the default Build task.
|
|
148
|
-
|
|
149
|
-
### Version & Release
|
|
150
|
-
|
|
151
|
-
```bash
|
|
152
|
-
yarn v # Update version (prompts for type)
|
|
153
|
-
yarn acp # Add, commit, push changes
|
|
154
|
-
yarn bacp # Build + add, commit, push
|
|
155
|
-
yarn r # Create GitHub release
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
### Code Quality
|
|
159
|
-
|
|
160
|
-
```bash
|
|
161
|
-
yarn lint # Check for linting errors
|
|
162
|
-
yarn lint:fix # Auto-fix linting errors
|
|
163
|
-
yarn prettier # Check formatting
|
|
164
|
-
yarn prettier:fix # Auto-format all files
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
### Recommended Workflow
|
|
168
|
-
|
|
169
|
-
1. `yarn start` - Install and start development
|
|
170
|
-
2. Make changes, test in Obsidian
|
|
171
|
-
3. `yarn bacp` - Build and commit changes
|
|
172
|
-
4. `yarn v` - Update version
|
|
173
|
-
5. `yarn r` - Create release
|
|
174
|
-
|
|
175
|
-
---
|
|
176
|
-
|
|
177
|
-
## Development (for contributors)
|
|
178
|
-
|
|
179
|
-
### Setup
|
|
180
|
-
|
|
181
|
-
```bash
|
|
182
|
-
git clone https://github.com/3C0D/obsidian-plugin-config
|
|
183
|
-
cd obsidian-plugin-config
|
|
184
|
-
yarn install
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
### Local injection commands
|
|
188
|
-
|
|
189
|
-
```bash
|
|
190
|
-
yarn inject-prompt # Interactive injection
|
|
191
|
-
yarn inject-path ../my-plugin # Direct injection
|
|
192
|
-
yarn check-plugin ../my-plugin # Dry-run only
|
|
193
|
-
```
|
|
194
|
-
|
|
195
|
-
### Publish workflow
|
|
196
|
-
|
|
197
|
-
```bash
|
|
198
|
-
yarn npm-publish # All-in-one:
|
|
199
|
-
# 1. Version bump
|
|
200
|
-
# 2. Generate bin/obsidian-inject.js
|
|
201
|
-
# 3. Verify package
|
|
202
|
-
# 4. Commit + push
|
|
203
|
-
# 5. Publish to NPM
|
|
204
|
-
# 6. Update global CLI (optional)
|
|
205
|
-
```
|
|
1
|
+
# Obsidian Plugin Config
|
|
2
|
+
|
|
3
|
+
🎯 Global CLI injection tool for Obsidian plugins.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/obsidian-plugin-config)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install -g obsidian-plugin-config
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Update
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install -g obsidian-plugin-config@latest --force
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage (global CLI)
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# Inject in current plugin directory
|
|
24
|
+
# Prompts for confirmation before replacing each existing file
|
|
25
|
+
obsidian-inject
|
|
26
|
+
|
|
27
|
+
# Inject by path
|
|
28
|
+
# Prompts for confirmation before replacing each existing file
|
|
29
|
+
obsidian-inject ../my-plugin
|
|
30
|
+
|
|
31
|
+
# Inject without confirmation
|
|
32
|
+
# Auto-confirms all file replacements (no prompts)
|
|
33
|
+
obsidian-inject ../my-plugin --no
|
|
34
|
+
|
|
35
|
+
# Verification only (dry-run)
|
|
36
|
+
# Shows what would be injected without making any changes
|
|
37
|
+
obsidian-inject ../my-plugin --dry-run
|
|
38
|
+
|
|
39
|
+
# Help
|
|
40
|
+
obsidian-inject --help
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## CLI Options
|
|
44
|
+
|
|
45
|
+
- `--no`, `-n` - Skip confirmation prompts (auto-confirm)
|
|
46
|
+
- `--dry-run` - Verification only (no changes)
|
|
47
|
+
|
|
48
|
+
## What is injected
|
|
49
|
+
|
|
50
|
+
- ✅ **Standalone local scripts**: `esbuild.config.ts`, `acp.ts`,
|
|
51
|
+
`update-version.ts`, `release.ts`, `help.ts`, `utils.ts`
|
|
52
|
+
- ✅ **package.json**: scripts, dependencies, yarn protection
|
|
53
|
+
- ✅ **tsconfig.json**: modern optimized TypeScript configuration
|
|
54
|
+
- ✅ **eslint.config.mts**: ESLint flat config
|
|
55
|
+
- ✅ **Config files**: `.editorconfig`, `.prettierrc`, `.npmrc`,
|
|
56
|
+
`.env`, `.vscode/settings.json`, `.vscode/tasks.json`
|
|
57
|
+
- ✅ **GitHub Actions**: release workflow
|
|
58
|
+
- ✅ **Traceability**: `.injection-info.json` (version, date)
|
|
59
|
+
- 🎨 **SCSS support**: automatic detection in the injected `esbuild.config.ts`
|
|
60
|
+
|
|
61
|
+
## Commands available after injection
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
yarn start # Install dependencies + start dev
|
|
65
|
+
yarn dev # Development build (watch mode)
|
|
66
|
+
yarn build # Production build
|
|
67
|
+
yarn real # Build + install to real vault
|
|
68
|
+
yarn acp # Add, commit, push
|
|
69
|
+
yarn bacp # Build + add, commit, push
|
|
70
|
+
yarn v # Update version
|
|
71
|
+
yarn r # GitHub release
|
|
72
|
+
yarn lint # ESLint check
|
|
73
|
+
yarn lint:fix # ESLint fix
|
|
74
|
+
yarn prettier # Prettier check
|
|
75
|
+
yarn prettier:fix # Prettier format all
|
|
76
|
+
yarn h # Full help
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Updating Dependencies
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
yarn upgrade # Update all dependencies to latest
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## SASS Support
|
|
86
|
+
|
|
87
|
+
SCSS is detected automatically by the injected `esbuild.config.ts`:
|
|
88
|
+
|
|
89
|
+
- ✅ Automatic `.scss` detection (`src/styles.scss` priority)
|
|
90
|
+
- ✅ CSS cleanup after compilation
|
|
91
|
+
|
|
92
|
+
If your plugin uses SCSS, install the plugin once:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
yarn add -D esbuild-sass-plugin
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Architecture
|
|
99
|
+
|
|
100
|
+
Target plugins become **100% standalone** after injection:
|
|
101
|
+
|
|
102
|
+
- ✅ Scripts integrated locally (no external runtime dependency)
|
|
103
|
+
- ✅ Updatable via re-injection
|
|
104
|
+
- ✅ Yarn protection enforced
|
|
105
|
+
- ✅ Compatible with all Obsidian plugins
|
|
106
|
+
|
|
107
|
+
## Development Workflow (for injected plugins)
|
|
108
|
+
|
|
109
|
+
After injection, your plugin has a complete development setup:
|
|
110
|
+
|
|
111
|
+
### Environment Setup
|
|
112
|
+
|
|
113
|
+
**In-place development** (inside vault):
|
|
114
|
+
- Develop directly in `.obsidian/plugins/your-plugin`
|
|
115
|
+
- Run `yarn dev` - builds automatically to current location
|
|
116
|
+
|
|
117
|
+
**External development** (outside vault):
|
|
118
|
+
- Develop anywhere on your system
|
|
119
|
+
- Configure `.env` file with vault paths:
|
|
120
|
+
```bash
|
|
121
|
+
TEST_VAULT=/path/to/test/vault
|
|
122
|
+
REAL_VAULT=/path/to/production/vault
|
|
123
|
+
```
|
|
124
|
+
- Run `yarn dev` - builds to TEST_VAULT
|
|
125
|
+
- Run `yarn real` - builds to REAL_VAULT
|
|
126
|
+
|
|
127
|
+
### Development Commands
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
yarn start # Install dependencies + start dev
|
|
131
|
+
yarn dev # Watch mode (auto-rebuild on changes)
|
|
132
|
+
yarn build # Production build
|
|
133
|
+
yarn real # Build to production vault
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### VSCode Tasks (Ctrl+Shift+P → "Run Task")
|
|
137
|
+
|
|
138
|
+
After injection, VSCode tasks are available for quick access:
|
|
139
|
+
|
|
140
|
+
- **Build** - Production build
|
|
141
|
+
- **Lint** / **Lint: Fix** - ESLint check/fix
|
|
142
|
+
- **Prettier: Check** / **Prettier: Fix** - Format check/fix
|
|
143
|
+
- **Obsidian Inject** - Re-inject configuration (with confirmation)
|
|
144
|
+
- **Obsidian Inject (no confirm)** - Re-inject without confirmation
|
|
145
|
+
- **Cleanup: Lint + Prettier + Build** - Full cleanup sequence
|
|
146
|
+
|
|
147
|
+
💡 **Tip**: Use `Ctrl+Shift+B` (Windows/Linux) or `Cmd+Shift+B` (Mac) for the default Build task.
|
|
148
|
+
|
|
149
|
+
### Version & Release
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
yarn v # Update version (prompts for type)
|
|
153
|
+
yarn acp # Add, commit, push changes
|
|
154
|
+
yarn bacp # Build + add, commit, push
|
|
155
|
+
yarn r # Create GitHub release
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### Code Quality
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
yarn lint # Check for linting errors
|
|
162
|
+
yarn lint:fix # Auto-fix linting errors
|
|
163
|
+
yarn prettier # Check formatting
|
|
164
|
+
yarn prettier:fix # Auto-format all files
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### Recommended Workflow
|
|
168
|
+
|
|
169
|
+
1. `yarn start` - Install and start development
|
|
170
|
+
2. Make changes, test in Obsidian
|
|
171
|
+
3. `yarn bacp` - Build and commit changes
|
|
172
|
+
4. `yarn v` - Update version
|
|
173
|
+
5. `yarn r` - Create release
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## Development (for contributors)
|
|
178
|
+
|
|
179
|
+
### Setup
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
git clone https://github.com/3C0D/obsidian-plugin-config
|
|
183
|
+
cd obsidian-plugin-config
|
|
184
|
+
yarn install
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### Local injection commands
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
yarn inject-prompt # Interactive injection
|
|
191
|
+
yarn inject-path ../my-plugin # Direct injection
|
|
192
|
+
yarn check-plugin ../my-plugin # Dry-run only
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### Publish workflow
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
yarn npm-publish # All-in-one:
|
|
199
|
+
# 1. Version bump
|
|
200
|
+
# 2. Generate bin/obsidian-inject.js
|
|
201
|
+
# 3. Verify package
|
|
202
|
+
# 4. Commit + push
|
|
203
|
+
# 5. Publish to NPM
|
|
204
|
+
# 6. Update global CLI (optional)
|
|
205
|
+
```
|