obsidian-plugin-config 1.6.13 → 1.6.15

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/DONE.md DELETED
@@ -1,60 +0,0 @@
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 DELETED
@@ -1,163 +0,0 @@
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`
@@ -1,82 +0,0 @@
1
- # Windows node_modules Cleanup Problem
2
-
3
- ## Issue
4
- Injection fails on Windows with EPERM error when Yarn tries to install dependencies:
5
- ```
6
- error Error: EPERM: operation not permitted, unlink 'C:\...\node_modules\@esbuild\win32-x64\esbuild.exe'
7
- ```
8
-
9
- ## Root Cause
10
- 1. Script reports "🗑️ Removed node_modules" but `rmdir /s /q` fails silently on locked .exe files
11
- 2. node_modules remains partially present with corrupted/locked files
12
- 3. Yarn tries to reuse this corrupted node_modules and fails
13
-
14
- ## Current Code (inject-core.ts, ~line 680)
15
- ```typescript
16
- if (fs.existsSync(nodeModulesPath)) {
17
- console.log(` ⏳ Removing node_modules (this may take a moment)...`);
18
- try {
19
- execSync(`rmdir /s /q "${nodeModulesPath}"`, {
20
- stdio: 'pipe',
21
- windowsHide: true
22
- });
23
- console.log(` 🗑️ Removed node_modules (will be reinstalled with Yarn)`);
24
- } catch {
25
- // Rename fallback - BUT THIS NEVER EXECUTES because rmdir doesn't throw!
26
- try {
27
- const timestamp = Date.now();
28
- const oldPath = `${nodeModulesPath}.old.${timestamp}`;
29
- fs.renameSync(nodeModulesPath, oldPath);
30
- console.log(` 🔄 Renamed locked node_modules to ${path.basename(oldPath)}`);
31
- } catch {
32
- console.log(` ⚠️ Could not remove/rename node_modules`);
33
- throw new Error('node_modules locked - close processes and retry');
34
- }
35
- }
36
- }
37
- ```
38
-
39
- ## Problem
40
- `execSync('rmdir /s /q ...')` with `stdio: 'pipe'` does NOT throw an exception when it fails to delete locked files. It exits with code 0 even though files remain.
41
-
42
- ## Required Fix
43
- After `rmdir` command, CHECK if node_modules still exists. If yes, execute the rename fallback:
44
-
45
- ```typescript
46
- if (fs.existsSync(nodeModulesPath)) {
47
- console.log(` ⏳ Removing node_modules (this may take a moment)...`);
48
-
49
- // Try to remove
50
- execSync(`rmdir /s /q "${nodeModulesPath}"`, {
51
- stdio: 'pipe',
52
- windowsHide: true
53
- });
54
-
55
- // CHECK if it actually worked
56
- if (fs.existsSync(nodeModulesPath)) {
57
- // rmdir failed silently - rename instead
58
- const timestamp = Date.now();
59
- const oldPath = `${nodeModulesPath}.old.${timestamp}`;
60
- try {
61
- fs.renameSync(nodeModulesPath, oldPath);
62
- console.log(` 🔄 Renamed locked node_modules to ${path.basename(oldPath)}`);
63
- console.log(` 💡 Delete it manually later: ${oldPath}`);
64
- } catch {
65
- console.log(` ⚠️ Could not remove/rename node_modules (locked by processes)`);
66
- console.log(` 💡 Close Obsidian/VSCode and run: obsidian-inject again`);
67
- throw new Error('node_modules locked - close processes and retry');
68
- }
69
- } else {
70
- console.log(` 🗑️ Removed node_modules (will be reinstalled with Yarn)`);
71
- }
72
- }
73
- ```
74
-
75
- ## File to Fix
76
- `scripts/inject-core.ts` - function `cleanNpmArtifactsIfNeeded` (around line 680-730)
77
-
78
- ## Test Case
79
- User runs `obsidian-inject` while VSCode is open on the plugin directory. The esbuild.exe file is locked by VSCode's TypeScript server.
80
-
81
- Expected: node_modules gets renamed to node_modules.old.{timestamp}, Yarn creates fresh node_modules
82
- Actual: rmdir fails silently, Yarn tries to use corrupted node_modules, EPERM error
@@ -1,104 +0,0 @@
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`
@@ -1,43 +0,0 @@
1
- # Notes Techniques
2
-
3
- ## tslib
4
-
5
- **Qu'est-ce que c'est ?**
6
- `tslib` est une bibliothèque runtime pour TypeScript qui contient les helpers TypeScript (comme `__awaiter`, `__extends`, `__spreadArray`, etc.).
7
-
8
- **Pourquoi c'est important ?**
9
- Quand tu utilises `"importHelpers": true` dans `tsconfig.json`, TypeScript importe ces helpers depuis tslib au lieu de les dupliquer dans chaque fichier compilé. Ça réduit significativement la taille du bundle.
10
-
11
- **Exemple :**
12
- Sans tslib, chaque fichier async duplique le helper `__awaiter` (~200 bytes).
13
- Avec tslib, un seul import : `import { __awaiter } from "tslib"`.
14
-
15
- **Version :**
16
- On utilise `"tslib": "2.4.0"` (version stable, pas latest) pour éviter les breaking changes.
17
-
18
- ## EditorConfig
19
-
20
- **Qu'est-ce que c'est ?**
21
- EditorConfig permet de définir des règles de formatage (indentation, line endings, etc.) qui fonctionnent dans tous les éditeurs.
22
-
23
- **Fichier injecté :**
24
- `.editorconfig` est automatiquement injecté dans le plugin.
25
-
26
- **Pour VSCode :**
27
- L'extension `editorconfig.editorconfig` doit être installée pour que VSCode respecte les règles.
28
-
29
- **Recommandations automatiques :**
30
- Le fichier `.vscode/extensions.json` suggère automatiquement les extensions nécessaires :
31
- - `esbenp.prettier-vscode` - Prettier
32
- - `dbaeumer.vscode-eslint` - ESLint
33
- - `editorconfig.editorconfig` - EditorConfig
34
- - `yzhang.markdown-all-in-one` - Markdown
35
-
36
- Quand l'utilisateur ouvre le projet, VSCode propose d'installer ces extensions.
37
-
38
- ## Prettier vs EditorConfig
39
-
40
- **EditorConfig** : Règles de base (tabs/spaces, line endings, charset)
41
- **Prettier** : Formatage avancé du code (quotes, semicolons, line width, etc.)
42
-
43
- Les deux sont complémentaires. EditorConfig s'applique à tous les fichiers, Prettier se concentre sur le code.
@@ -1,127 +0,0 @@
1
- # Architecture Finale - Outil d'Injection Pur
2
-
3
- ## ✅ Décisions Prises
4
-
5
- ### 1. Suppression du développement local de plugin
6
- - **Avant** : Le projet servait à la fois d'outil d'injection ET de plugin local pour tester du code
7
- - **Après** : Outil d'injection pur, pas de développement local
8
- - **Raison** : Trop complexe pour les utilisateurs, dépendance inutile
9
-
10
- ### 2. Suppression du système d'exports NPM
11
- - **Avant** : `src/` contenait du code exportable (modals, utils) via NPM
12
- - **Après** : Plus d'exports, uniquement injection de fichiers
13
- - **Raison** : Les utilisateurs préfèrent avoir le code directement dans leur plugin plutôt qu'une dépendance externe
14
-
15
- ### 3. Workflow simplifié
16
- - **Avant** : Développement local → exports → injection
17
- - **Après** : Modification templates → publication NPM → injection globale
18
- - **Raison** : Un seul flux, plus simple à comprendre et maintenir
19
-
20
- ## 🗑️ Fichiers Supprimés
21
-
22
- ### Dossiers
23
- - `src/` - Code du plugin local et exports
24
- - `.vscode/` - Configuration VSCode (optionnel)
25
-
26
- ### Fichiers racine
27
- - `manifest.json` - Manifeste du plugin Obsidian
28
- - `versions.json` - Versions du plugin
29
- - `.injection-info.json` - Métadonnées d'injection (pour plugins injectés uniquement)
30
- - `.env` - Chemins des vaults (plus nécessaire)
31
- - `CLEANUP.md` - Guide de nettoyage (obsolète après nettoyage)
32
- - `CHANGES.md` - Résumé des changements (obsolète)
33
-
34
- ### Scripts
35
- - `scripts/esbuild.config.ts` - Build du plugin local
36
- - `scripts/sync-template-deps.ts` - Sync des dépendances
37
- - `scripts/update-exports.js` - Génération des exports
38
-
39
- ### Documentation
40
- - `docs/EXPORTS-EXPLAINED.md` - Explication du système d'exports
41
-
42
- ## 📦 Structure Finale
43
-
44
- ```
45
- obsidian-plugin-config/
46
- ├── bin/
47
- │ └── obsidian-inject.js # CLI global (généré)
48
- ├── docs/
49
- │ ├── LLM-GUIDE.md # Guide pour LLM (mis à jour)
50
- │ └── implementation_plan.md # Ce fichier
51
- ├── scripts/
52
- │ ├── inject-core.ts # Logique d'injection
53
- │ ├── inject-path.ts # CLI avec flags
54
- │ ├── inject-prompt.ts # CLI interactif
55
- │ ├── build-npm.ts # Workflow de publication
56
- │ ├── acp.ts # Add, commit, push
57
- │ ├── help.ts # Aide
58
- │ ├── update-version-config.ts # Bump de version
59
- │ └── utils.ts # Utilitaires
60
- ├── templates/ # SOURCE DE VÉRITÉ
61
- │ ├── scripts/ # Scripts injectés
62
- │ ├── .github/workflows/ # GitHub Actions
63
- │ ├── package.json # Config de base
64
- │ ├── package-sass.json # Config SASS
65
- │ ├── tsconfig.json # Config TypeScript
66
- │ ├── eslint.config.mts # Config ESLint
67
- │ └── ... # Autres configs
68
- ├── .npmignore # Exclusions NPM
69
- ├── package.json # Config de l'outil
70
- ├── tsconfig.json # Config TS (nettoyée)
71
- ├── README.md # Documentation
72
- └── ...
73
- ```
74
-
75
- ## 🔄 Workflow de Développement
76
-
77
- ### Modifier ce qui est injecté
78
- 1. Éditer les fichiers dans `templates/`
79
- 2. Tester localement : `yarn inject-path ../test-plugin`
80
- 3. Publier : `yarn npm-publish`
81
- 4. Installer globalement : `npm install -g obsidian-plugin-config@latest --force`
82
-
83
- ### Utilisation globale
84
- ```bash
85
- obsidian-inject # Dans le dossier du plugin
86
- obsidian-inject ../my-plugin # Par chemin
87
- obsidian-inject ../my-plugin --sass # Avec SASS
88
- ```
89
-
90
- ## 🎯 Ce qui reste à faire
91
-
92
- ### Nettoyage des dépendances
93
- ```bash
94
- yarn remove obsidian obsidian-typings esbuild builtin-modules dotenv
95
- ```
96
-
97
- ### Vérification
98
- ```bash
99
- yarn lint # Vérifier le code
100
- yarn inject-prompt # Tester l'injection
101
- ```
102
-
103
- ## 📝 Notes Importantes
104
-
105
- ### Templates = Source de vérité
106
- - **JAMAIS** modifier les fichiers racine en pensant que ça affectera l'injection
107
- - **TOUJOURS** modifier `templates/` pour changer ce qui est injecté
108
- - Les scripts dans `scripts/` sont pour l'outil lui-même, pas pour l'injection
109
-
110
- ### Pas de test local
111
- - Plus besoin de `.env` avec TEST_VAULT et REAL_VAULT
112
- - Plus de `yarn dev` ou `yarn real`
113
- - Tout passe par NPM global : modifier → publier → installer → tester
114
-
115
- ### Plugins injectés = 100% autonomes
116
- - Aucune dépendance à `obsidian-plugin-config` après injection
117
- - Tous les scripts sont copiés localement
118
- - Mise à jour possible via ré-injection
119
-
120
- ## 🚀 Prochaines Étapes
121
-
122
- 1. ✅ Supprimer les fichiers obsolètes
123
- 2. ✅ Nettoyer `tsconfig.json`
124
- 3. ✅ Mettre à jour la documentation
125
- 4. ⏳ Supprimer les dépendances inutiles
126
- 5. ⏳ Tester l'injection
127
- 6. ⏳ Publier la nouvelle version