obsidian-plugin-config 1.5.12 → 1.6.1
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/.vscode/tasks.json +5 -69
- package/DONE.md +60 -0
- package/FINAL_SUMMARY.md +163 -0
- package/README.md +70 -35
- package/bin/obsidian-inject.js +1 -1
- package/docs/APPLIED_MODIFS.md +104 -0
- package/docs/INTERACTIVE_INJECTION.md +137 -0
- package/docs/LLM-GUIDE.md +60 -50
- package/docs/TECHNICAL_NOTES.md +43 -0
- package/docs/implementation_plan.md +127 -0
- package/docs/modifs.md +434 -0
- package/package.json +3 -29
- package/scripts/acp.ts +7 -11
- package/scripts/build-npm.ts +78 -75
- package/scripts/help.ts +45 -107
- package/scripts/inject-core.ts +74 -36
- package/scripts/inject-options.ts +139 -0
- package/scripts/inject-path.ts +18 -4
- package/scripts/inject-prompt.ts +2 -1
- package/scripts/update-version-config.ts +2 -5
- package/templates/.gitattributes +4 -0
- package/templates/.github/workflows/release.yml +1 -1
- package/templates/.prettierignore +6 -0
- package/templates/.vscode/extensions.json +8 -0
- package/templates/.vscode/settings.json +0 -1
- package/templates/package.json +3 -2
- package/templates/scripts/esbuild.config.ts +16 -21
- package/tsconfig.json +2 -8
- package/.injection-info.json +0 -5
- package/docs/EXPORTS-EXPLAINED.md +0 -164
- package/manifest.json +0 -11
- package/scripts/esbuild.config.ts +0 -268
- package/scripts/sync-template-deps.ts +0 -59
- package/scripts/update-exports.js +0 -82
- package/src/index.ts +0 -6
- package/src/main.ts +0 -117
- package/src/modals/GenericConfirmModal.ts +0 -79
- package/src/modals/index.ts +0 -7
- package/src/tools/index.ts +0 -9
- package/src/utils/NoticeHelper.ts +0 -85
- package/src/utils/SettingsHelper.ts +0 -170
- package/src/utils/index.ts +0 -3
- package/versions.json +0 -64
package/.vscode/tasks.json
CHANGED
|
@@ -1,31 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": "2.0.0",
|
|
3
3
|
"tasks": [
|
|
4
|
-
{
|
|
5
|
-
"label": "Build",
|
|
6
|
-
"type": "shell",
|
|
7
|
-
"command": "yarn build",
|
|
8
|
-
"group": { "kind": "build", "isDefault": true },
|
|
9
|
-
"presentation": { "reveal": "always", "panel": "shared" },
|
|
10
|
-
"problemMatcher": ["$tsc"]
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"label": "Dev (watch)",
|
|
14
|
-
"type": "shell",
|
|
15
|
-
"command": "yarn dev",
|
|
16
|
-
"group": "build",
|
|
17
|
-
"presentation": { "reveal": "always", "panel": "shared" },
|
|
18
|
-
"problemMatcher": ["$tsc-watch"],
|
|
19
|
-
"isBackground": true
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"label": "Real (build to vault)",
|
|
23
|
-
"type": "shell",
|
|
24
|
-
"command": "yarn real",
|
|
25
|
-
"group": "build",
|
|
26
|
-
"presentation": { "reveal": "always", "panel": "shared" },
|
|
27
|
-
"problemMatcher": ["$tsc"]
|
|
28
|
-
},
|
|
29
4
|
{
|
|
30
5
|
"label": "Lint",
|
|
31
6
|
"type": "shell",
|
|
@@ -58,14 +33,6 @@
|
|
|
58
33
|
"presentation": { "reveal": "always", "panel": "shared" },
|
|
59
34
|
"problemMatcher": []
|
|
60
35
|
},
|
|
61
|
-
{
|
|
62
|
-
"label": "Update Exports",
|
|
63
|
-
"type": "shell",
|
|
64
|
-
"command": "yarn update-exports",
|
|
65
|
-
"group": "build",
|
|
66
|
-
"presentation": { "reveal": "always", "panel": "shared" },
|
|
67
|
-
"problemMatcher": []
|
|
68
|
-
},
|
|
69
36
|
{
|
|
70
37
|
"label": "ACP (add, commit, push)",
|
|
71
38
|
"type": "shell",
|
|
@@ -74,50 +41,19 @@
|
|
|
74
41
|
"presentation": { "reveal": "always", "panel": "shared" },
|
|
75
42
|
"problemMatcher": []
|
|
76
43
|
},
|
|
77
|
-
{
|
|
78
|
-
"label": "BACP (build + acp)",
|
|
79
|
-
"type": "shell",
|
|
80
|
-
"command": "yarn bacp",
|
|
81
|
-
"group": "build",
|
|
82
|
-
"presentation": { "reveal": "always", "panel": "shared" },
|
|
83
|
-
"problemMatcher": []
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
"label": "Version update",
|
|
87
|
-
"type": "shell",
|
|
88
|
-
"command": "yarn v",
|
|
89
|
-
"group": "build",
|
|
90
|
-
"presentation": { "reveal": "always", "panel": "shared" },
|
|
91
|
-
"problemMatcher": []
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
"label": "Upgrade All (yarn upgrade + sync templates)",
|
|
95
|
-
"type": "shell",
|
|
96
|
-
"command": "yarn upgrade-all",
|
|
97
|
-
"group": "build",
|
|
98
|
-
"presentation": { "reveal": "always", "panel": "shared" },
|
|
99
|
-
"problemMatcher": []
|
|
100
|
-
},
|
|
101
44
|
{
|
|
102
45
|
"label": "NPM Publish",
|
|
103
46
|
"type": "shell",
|
|
104
|
-
"command": "yarn npm-publish
|
|
105
|
-
"group": "build",
|
|
106
|
-
"presentation": { "reveal": "always", "panel": "shared" },
|
|
107
|
-
"problemMatcher": []
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
"label": "Install/Update obsidian-inject",
|
|
111
|
-
"type": "shell",
|
|
112
|
-
"command": "npm list -g obsidian-plugin-config --depth=0 && npm install -g obsidian-plugin-config@latest --force --engine-strict=false && npm list -g obsidian-plugin-config --depth=0",
|
|
113
|
-
"group": "build",
|
|
47
|
+
"command": "yarn npm-publish",
|
|
48
|
+
"group": { "kind": "build", "isDefault": true },
|
|
114
49
|
"presentation": { "reveal": "always", "panel": "shared" },
|
|
115
50
|
"problemMatcher": []
|
|
116
51
|
},
|
|
52
|
+
|
|
117
53
|
{
|
|
118
|
-
"label": "Cleanup: Lint + Prettier
|
|
54
|
+
"label": "Cleanup: Lint + Prettier",
|
|
119
55
|
"dependsOrder": "sequence",
|
|
120
|
-
"dependsOn": ["Lint: Fix", "Prettier: Fix"
|
|
56
|
+
"dependsOn": ["Lint: Fix", "Prettier: Fix"],
|
|
121
57
|
"group": "build",
|
|
122
58
|
"presentation": { "reveal": "always", "panel": "shared" },
|
|
123
59
|
"problemMatcher": []
|
package/DONE.md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Transformation Terminée ✅
|
|
2
|
+
|
|
3
|
+
## Résumé
|
|
4
|
+
|
|
5
|
+
Le projet **obsidian-plugin-config** est maintenant un **outil d'injection pur**.
|
|
6
|
+
|
|
7
|
+
## Ce qui a été fait
|
|
8
|
+
|
|
9
|
+
### ✅ Fichiers supprimés
|
|
10
|
+
- `src/` - Code du plugin local et exports
|
|
11
|
+
- `manifest.json`, `versions.json`, `.injection-info.json` - Fichiers du plugin
|
|
12
|
+
- `scripts/esbuild.config.ts` - Build local
|
|
13
|
+
- `scripts/sync-template-deps.ts` - Sync dépendances
|
|
14
|
+
- `scripts/update-exports.js` - Génération exports
|
|
15
|
+
- `docs/EXPORTS-EXPLAINED.md` - Doc exports
|
|
16
|
+
- `CLEANUP.md`, `CHANGES.md` - Guides temporaires
|
|
17
|
+
|
|
18
|
+
### ✅ Fichiers mis à jour
|
|
19
|
+
- `README.md` - Simplifié, focus injection
|
|
20
|
+
- `package.json` - Retiré exports, scripts inutiles, dépendances
|
|
21
|
+
- `tsconfig.json` - Retiré références à src/ et obsidian-typings
|
|
22
|
+
- `scripts/build-npm.ts` - Retiré étape update-exports
|
|
23
|
+
- `scripts/help.ts` - Simplifié
|
|
24
|
+
- `docs/LLM-GUIDE.md` - Focus injection uniquement
|
|
25
|
+
- `.npmignore` - Exclusion des fichiers dev
|
|
26
|
+
|
|
27
|
+
### ✅ Nouveaux fichiers
|
|
28
|
+
- `docs/implementation_plan.md` - Plan et décisions
|
|
29
|
+
|
|
30
|
+
## Structure finale
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
obsidian-plugin-config/
|
|
34
|
+
├── bin/obsidian-inject.js # CLI global
|
|
35
|
+
├── scripts/inject-*.ts # Logique d'injection
|
|
36
|
+
├── templates/ # Ce qui est injecté
|
|
37
|
+
├── docs/ # Documentation
|
|
38
|
+
└── package.json # Config outil
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Utilisation
|
|
42
|
+
|
|
43
|
+
### Développement
|
|
44
|
+
```bash
|
|
45
|
+
# Modifier templates/
|
|
46
|
+
yarn lint:fix
|
|
47
|
+
yarn npm-publish
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Global
|
|
51
|
+
```bash
|
|
52
|
+
npm install -g obsidian-plugin-config@latest --force
|
|
53
|
+
obsidian-inject ../my-plugin
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Prochaines étapes
|
|
57
|
+
|
|
58
|
+
1. Tester : `yarn lint`
|
|
59
|
+
2. Tester injection : `yarn inject-prompt`
|
|
60
|
+
3. Publier : `yarn npm-publish`
|
package/FINAL_SUMMARY.md
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# Résumé Final - Transformation Complète
|
|
2
|
+
|
|
3
|
+
## ✅ Transformation en Outil d'Injection Pur
|
|
4
|
+
|
|
5
|
+
### Fichiers Supprimés
|
|
6
|
+
- `src/` - Code du plugin local et exports
|
|
7
|
+
- `manifest.json`, `versions.json`, `.injection-info.json`
|
|
8
|
+
- `scripts/esbuild.config.ts`, `scripts/sync-template-deps.ts`, `scripts/update-exports.js`
|
|
9
|
+
- `docs/EXPORTS-EXPLAINED.md`
|
|
10
|
+
- `CLEANUP.md`, `CHANGES.md`
|
|
11
|
+
|
|
12
|
+
### Fichiers Mis à Jour
|
|
13
|
+
|
|
14
|
+
#### README.md
|
|
15
|
+
- Ajout section "Development Workflow (for injected plugins)"
|
|
16
|
+
- Ajout commandes prettier
|
|
17
|
+
- Ajout `yarn upgrade` pour mises à jour
|
|
18
|
+
- Simplifié focus injection
|
|
19
|
+
|
|
20
|
+
#### package.json (racine)
|
|
21
|
+
- Retiré `main`, `exports`
|
|
22
|
+
- Retiré scripts: `dev`, `real`, `build`, `bacp`, `update-exports`, `sync-template-deps`, `upgrade-all`
|
|
23
|
+
- Retiré dépendances: `obsidian`, `obsidian-typings`, `esbuild`, `builtin-modules`, `dotenv`
|
|
24
|
+
|
|
25
|
+
#### tsconfig.json (racine)
|
|
26
|
+
- Retiré `types: ["obsidian-typings"]` et `paths`
|
|
27
|
+
- Retiré `./src/**/*.ts` de `include`
|
|
28
|
+
|
|
29
|
+
#### scripts/build-npm.ts
|
|
30
|
+
- Retiré étape update-exports
|
|
31
|
+
- Retiré sync versions.json/manifest.json
|
|
32
|
+
- 5 étapes au lieu de 7
|
|
33
|
+
|
|
34
|
+
#### scripts/help.ts
|
|
35
|
+
- Simplifié, focus injection uniquement
|
|
36
|
+
|
|
37
|
+
#### docs/LLM-GUIDE.md
|
|
38
|
+
- Retiré sections exports et plugin local
|
|
39
|
+
- Focus injection pure
|
|
40
|
+
|
|
41
|
+
### Templates Améliorés
|
|
42
|
+
|
|
43
|
+
#### templates/tsconfig.json
|
|
44
|
+
- Ajout `"templates"` dans `exclude`
|
|
45
|
+
|
|
46
|
+
#### templates/package.json
|
|
47
|
+
- Ajout `"tslib": "2.4.0"`
|
|
48
|
+
- Prettier version `"^3.8.1"`
|
|
49
|
+
|
|
50
|
+
#### templates/eslint.config.mts
|
|
51
|
+
- Ajout `"templates/**"` dans ignores
|
|
52
|
+
|
|
53
|
+
#### Nouveaux fichiers templates
|
|
54
|
+
- `.prettierignore`
|
|
55
|
+
- `.gitattributes`
|
|
56
|
+
- `.vscode/settings.json`
|
|
57
|
+
- `.vscode/tasks.json` (déjà existait)
|
|
58
|
+
|
|
59
|
+
#### templates/scripts/esbuild.config.ts
|
|
60
|
+
- Amélioration détection in-place vs external
|
|
61
|
+
- Meilleure gestion prompts vault paths
|
|
62
|
+
|
|
63
|
+
## 📦 Structure Finale
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
obsidian-plugin-config/
|
|
67
|
+
├── bin/
|
|
68
|
+
│ └── obsidian-inject.js # CLI global
|
|
69
|
+
├── docs/
|
|
70
|
+
│ ├── LLM-GUIDE.md # Guide injection
|
|
71
|
+
│ ├── implementation_plan.md # Plan et décisions
|
|
72
|
+
│ ├── APPLIED_MODIFS.md # Modifs appliquées
|
|
73
|
+
│ └── modifs.md # Source des modifs
|
|
74
|
+
├── scripts/
|
|
75
|
+
│ ├── inject-core.ts # Logique injection
|
|
76
|
+
│ ├── inject-path.ts # CLI avec flags
|
|
77
|
+
│ ├── inject-prompt.ts # CLI interactif
|
|
78
|
+
│ ├── build-npm.ts # Publication NPM
|
|
79
|
+
│ ├── acp.ts # Git workflow
|
|
80
|
+
│ ├── help.ts # Aide
|
|
81
|
+
│ ├── update-version-config.ts # Version bump
|
|
82
|
+
│ └── utils.ts # Utilitaires
|
|
83
|
+
├── templates/ # SOURCE DE VÉRITÉ
|
|
84
|
+
│ ├── scripts/ # Scripts injectés
|
|
85
|
+
│ ├── .github/workflows/ # GitHub Actions
|
|
86
|
+
│ ├── .vscode/ # VSCode config
|
|
87
|
+
│ ├── package.json # Config base
|
|
88
|
+
│ ├── package-sass.json # Config SASS
|
|
89
|
+
│ ├── tsconfig.json # Config TypeScript
|
|
90
|
+
│ ├── eslint.config.mts # Config ESLint
|
|
91
|
+
│ ├── .prettierrc # Config Prettier
|
|
92
|
+
│ ├── .prettierignore # Prettier ignores
|
|
93
|
+
│ ├── .gitattributes # Git line endings
|
|
94
|
+
│ ├── .editorconfig # EditorConfig
|
|
95
|
+
│ └── ...
|
|
96
|
+
├── .npmignore # Exclusions NPM
|
|
97
|
+
├── package.json # Config outil
|
|
98
|
+
├── tsconfig.json # Config TS outil
|
|
99
|
+
├── README.md # Documentation
|
|
100
|
+
└── DONE.md # Résumé transformation
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## 🎯 Utilisation
|
|
104
|
+
|
|
105
|
+
### Installation globale
|
|
106
|
+
```bash
|
|
107
|
+
npm install -g obsidian-plugin-config@latest --force
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Injection
|
|
111
|
+
```bash
|
|
112
|
+
cd my-plugin
|
|
113
|
+
obsidian-inject # Injection simple
|
|
114
|
+
obsidian-inject --sass # Avec SASS
|
|
115
|
+
obsidian-inject --dry-run # Vérification
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### Développement outil
|
|
119
|
+
```bash
|
|
120
|
+
yarn lint:fix # Fix code
|
|
121
|
+
yarn inject-prompt # Test local
|
|
122
|
+
yarn npm-publish # Publier
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## 🚀 Workflow Plugin Injecté
|
|
126
|
+
|
|
127
|
+
### In-place (dans vault)
|
|
128
|
+
```bash
|
|
129
|
+
cd /vault/.obsidian/plugins/my-plugin
|
|
130
|
+
yarn dev
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### External (hors vault)
|
|
134
|
+
```bash
|
|
135
|
+
cd /projects/my-plugin
|
|
136
|
+
# Configurer .env
|
|
137
|
+
yarn dev # Build vers TEST_VAULT
|
|
138
|
+
yarn real # Build vers REAL_VAULT
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Release
|
|
142
|
+
```bash
|
|
143
|
+
yarn bacp # Build + commit
|
|
144
|
+
yarn v # Version bump
|
|
145
|
+
yarn r # GitHub release
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## ✨ Améliorations Clés
|
|
149
|
+
|
|
150
|
+
1. **Architecture simplifiée** - Outil d'injection pur, pas de double rôle
|
|
151
|
+
2. **Templates améliorés** - Configs à jour, nouveaux fichiers
|
|
152
|
+
3. **Workflow clarifié** - Documentation complète dans README
|
|
153
|
+
4. **Détection améliorée** - In-place vs external plus robuste
|
|
154
|
+
5. **VSCode intégré** - Settings et tasks prêts à l'emploi
|
|
155
|
+
6. **Prettier intégré** - Format automatique du code
|
|
156
|
+
7. **Git line endings** - .gitattributes pour éviter problèmes Windows/Unix
|
|
157
|
+
|
|
158
|
+
## 📝 Prochaines Étapes
|
|
159
|
+
|
|
160
|
+
1. Tester injection : `yarn inject-prompt`
|
|
161
|
+
2. Vérifier dans plugin test
|
|
162
|
+
3. Publier : `yarn npm-publish`
|
|
163
|
+
4. Mettre à jour global : `npm install -g obsidian-plugin-config@latest --force`
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Obsidian Plugin Config
|
|
2
2
|
|
|
3
|
-
🎯
|
|
3
|
+
🎯 Global CLI injection tool for Obsidian plugins.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/obsidian-plugin-config)
|
|
6
6
|
[](LICENSE)
|
|
@@ -59,10 +59,18 @@ yarn real # Build + install to real vault
|
|
|
59
59
|
yarn acp # Add, commit, push
|
|
60
60
|
yarn bacp # Build + add, commit, push
|
|
61
61
|
yarn v # Update version
|
|
62
|
-
yarn
|
|
62
|
+
yarn r # GitHub release
|
|
63
63
|
yarn lint # ESLint check
|
|
64
64
|
yarn lint:fix # ESLint fix
|
|
65
|
-
yarn
|
|
65
|
+
yarn prettier # Prettier check
|
|
66
|
+
yarn prettier:fix # Prettier format all
|
|
67
|
+
yarn h # Full help
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Updating Dependencies
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
yarn upgrade # Update all dependencies to latest
|
|
66
74
|
```
|
|
67
75
|
|
|
68
76
|
## SASS Support
|
|
@@ -78,49 +86,81 @@ What gets added:
|
|
|
78
86
|
|
|
79
87
|
## Architecture
|
|
80
88
|
|
|
81
|
-
|
|
89
|
+
Target plugins become **100% standalone** after injection:
|
|
82
90
|
|
|
83
91
|
- ✅ Scripts integrated locally (no external runtime dependency)
|
|
84
92
|
- ✅ Updatable via re-injection
|
|
85
93
|
- ✅ Yarn protection enforced
|
|
86
94
|
- ✅ Compatible with all Obsidian plugins
|
|
87
95
|
|
|
88
|
-
|
|
96
|
+
## Development Workflow (for injected plugins)
|
|
89
97
|
|
|
90
|
-
|
|
98
|
+
After injection, your plugin has a complete development setup:
|
|
91
99
|
|
|
92
|
-
|
|
100
|
+
### Environment Setup
|
|
93
101
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
102
|
+
**In-place development** (inside vault):
|
|
103
|
+
- Develop directly in `.obsidian/plugins/your-plugin`
|
|
104
|
+
- Run `yarn dev` - builds automatically to current location
|
|
97
105
|
|
|
98
|
-
|
|
106
|
+
**External development** (outside vault):
|
|
107
|
+
- Develop anywhere on your system
|
|
108
|
+
- Configure `.env` file with vault paths:
|
|
109
|
+
```bash
|
|
110
|
+
TEST_VAULT=/path/to/test/vault
|
|
111
|
+
REAL_VAULT=/path/to/production/vault
|
|
112
|
+
```
|
|
113
|
+
- Run `yarn dev` - builds to TEST_VAULT
|
|
114
|
+
- Run `yarn real` - builds to REAL_VAULT
|
|
115
|
+
|
|
116
|
+
### Development Commands
|
|
99
117
|
|
|
100
118
|
```bash
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
yarn
|
|
119
|
+
yarn start # Install dependencies + start dev
|
|
120
|
+
yarn dev # Watch mode (auto-rebuild on changes)
|
|
121
|
+
yarn build # Production build
|
|
122
|
+
yarn real # Build to production vault
|
|
104
123
|
```
|
|
105
124
|
|
|
106
|
-
###
|
|
125
|
+
### Version & Release
|
|
107
126
|
|
|
108
127
|
```bash
|
|
109
|
-
#
|
|
110
|
-
|
|
111
|
-
|
|
128
|
+
yarn v # Update version (prompts for type)
|
|
129
|
+
yarn acp # Add, commit, push changes
|
|
130
|
+
yarn bacp # Build + add, commit, push
|
|
131
|
+
yarn r # Create GitHub release
|
|
112
132
|
```
|
|
113
133
|
|
|
114
|
-
###
|
|
134
|
+
### Code Quality
|
|
115
135
|
|
|
116
136
|
```bash
|
|
117
|
-
yarn
|
|
118
|
-
yarn
|
|
119
|
-
yarn
|
|
120
|
-
yarn
|
|
137
|
+
yarn lint # Check for linting errors
|
|
138
|
+
yarn lint:fix # Auto-fix linting errors
|
|
139
|
+
yarn prettier # Check formatting
|
|
140
|
+
yarn prettier:fix # Auto-format all files
|
|
121
141
|
```
|
|
122
142
|
|
|
123
|
-
###
|
|
143
|
+
### Recommended Workflow
|
|
144
|
+
|
|
145
|
+
1. `yarn start` - Install and start development
|
|
146
|
+
2. Make changes, test in Obsidian
|
|
147
|
+
3. `yarn bacp` - Build and commit changes
|
|
148
|
+
4. `yarn v` - Update version
|
|
149
|
+
5. `yarn r` - Create release
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## Development (for contributors)
|
|
154
|
+
|
|
155
|
+
### Setup
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
git clone https://github.com/3C0D/obsidian-plugin-config
|
|
159
|
+
cd obsidian-plugin-config
|
|
160
|
+
yarn install
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Local injection commands
|
|
124
164
|
|
|
125
165
|
```bash
|
|
126
166
|
yarn inject-prompt # Interactive injection
|
|
@@ -132,16 +172,11 @@ yarn check-plugin ../my-plugin # Dry-run only
|
|
|
132
172
|
### Publish workflow
|
|
133
173
|
|
|
134
174
|
```bash
|
|
135
|
-
yarn npm-publish # All-in-one
|
|
136
|
-
# 0. NPM auth check
|
|
175
|
+
yarn npm-publish # All-in-one:
|
|
137
176
|
# 1. Version bump
|
|
138
|
-
# 2.
|
|
139
|
-
# 3.
|
|
140
|
-
# 4.
|
|
141
|
-
# 5.
|
|
142
|
-
# 6.
|
|
143
|
-
# 7. Update global CLI (ask, or auto with --auto-update)
|
|
177
|
+
# 2. Generate bin/obsidian-inject.js
|
|
178
|
+
# 3. Verify package
|
|
179
|
+
# 4. Commit + push
|
|
180
|
+
# 5. Publish to NPM
|
|
181
|
+
# 6. Update global CLI (optional)
|
|
144
182
|
```
|
|
145
|
-
|
|
146
|
-
> `yarn acp` is only needed for intermediate commits —
|
|
147
|
-
> not required before `yarn npm-publish`.
|
package/bin/obsidian-inject.js
CHANGED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# Modifications Appliquées depuis modifs.md
|
|
2
|
+
|
|
3
|
+
## ✅ Fichiers Templates Mis à Jour
|
|
4
|
+
|
|
5
|
+
### tsconfig.json
|
|
6
|
+
- Ajout de `"templates"` dans `exclude`
|
|
7
|
+
|
|
8
|
+
### package.json
|
|
9
|
+
- Ajout de `"tslib": "2.4.0"` dans devDependencies
|
|
10
|
+
- Version prettier fixée à `"^3.8.1"`
|
|
11
|
+
|
|
12
|
+
### eslint.config.mts
|
|
13
|
+
- Ajout de `"templates/**"` dans ignores
|
|
14
|
+
|
|
15
|
+
### Nouveaux fichiers créés
|
|
16
|
+
|
|
17
|
+
#### .prettierignore
|
|
18
|
+
```
|
|
19
|
+
# Build output
|
|
20
|
+
dist/
|
|
21
|
+
main.js
|
|
22
|
+
|
|
23
|
+
# Dependencies
|
|
24
|
+
node_modules/
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
#### .gitattributes
|
|
28
|
+
```
|
|
29
|
+
# On Windows, git defaults to core.autocrlf=true
|
|
30
|
+
* text=auto eol=lf
|
|
31
|
+
*.ts text eol=lf
|
|
32
|
+
*.json text eol=lf
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
#### .vscode/settings.json
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"npm.packageManager": "yarn",
|
|
39
|
+
"[typescript]": {
|
|
40
|
+
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
|
41
|
+
},
|
|
42
|
+
"[markdown]": {
|
|
43
|
+
"editor.defaultFormatter": "yzhang.markdown-all-in-one"
|
|
44
|
+
},
|
|
45
|
+
"editor.formatOnSave": true
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
#### .vscode/tasks.json
|
|
50
|
+
- Tâches pour lint, prettier, build
|
|
51
|
+
- Tâche "Obsidian Inject"
|
|
52
|
+
- Tâche "Cleanup" combinée
|
|
53
|
+
|
|
54
|
+
### esbuild.config.ts
|
|
55
|
+
- Amélioration de la logique de détection in-place vs external
|
|
56
|
+
- Détection plus claire du dossier plugins
|
|
57
|
+
- Meilleure gestion des prompts pour vault paths
|
|
58
|
+
|
|
59
|
+
## 📝 Notes
|
|
60
|
+
|
|
61
|
+
### Extensions VSCode recommandées
|
|
62
|
+
Les fichiers .vscode/settings.json suggèrent d'installer :
|
|
63
|
+
- `esbenp.prettier-vscode` - Prettier formatter
|
|
64
|
+
- `yzhang.markdown-all-in-one` - Markdown formatter
|
|
65
|
+
- EditorConfig extension (pour .editorconfig)
|
|
66
|
+
|
|
67
|
+
### Commandes disponibles après injection
|
|
68
|
+
```bash
|
|
69
|
+
yarn start # Install + dev
|
|
70
|
+
yarn dev # Watch mode
|
|
71
|
+
yarn build # Production build
|
|
72
|
+
yarn real # Build to real vault
|
|
73
|
+
yarn acp # Add, commit, push
|
|
74
|
+
yarn bacp # Build + acp
|
|
75
|
+
yarn v # Update version
|
|
76
|
+
yarn r # Release
|
|
77
|
+
yarn h # Help
|
|
78
|
+
yarn lint # ESLint check
|
|
79
|
+
yarn lint:fix # ESLint fix
|
|
80
|
+
yarn prettier # Prettier check
|
|
81
|
+
yarn prettier:fix # Prettier fix
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Workflow de développement
|
|
85
|
+
|
|
86
|
+
#### In-place (dans .obsidian/plugins)
|
|
87
|
+
```bash
|
|
88
|
+
cd /path/to/vault/.obsidian/plugins/my-plugin
|
|
89
|
+
yarn dev
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
#### External (hors vault)
|
|
93
|
+
```bash
|
|
94
|
+
cd /path/to/my-plugin
|
|
95
|
+
# Configure .env avec TEST_VAULT et REAL_VAULT
|
|
96
|
+
yarn dev # Build vers TEST_VAULT
|
|
97
|
+
yarn real # Build vers REAL_VAULT
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## 🔄 Prochaines étapes
|
|
101
|
+
|
|
102
|
+
1. Tester l'injection : `yarn inject-prompt`
|
|
103
|
+
2. Vérifier dans un plugin test
|
|
104
|
+
3. Publier : `yarn npm-publish`
|