obsidian-plugin-config 1.5.12 → 1.6.0
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 +3 -60
- 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 +6 -1
- package/scripts/build-npm.ts +48 -49
- 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
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# Système d'Injection Interactive
|
|
2
|
+
|
|
3
|
+
## ✅ Fonctionnalité Ajoutée
|
|
4
|
+
|
|
5
|
+
Un système de sélection interactive permet maintenant de choisir quels fichiers injecter.
|
|
6
|
+
|
|
7
|
+
## Utilisation
|
|
8
|
+
|
|
9
|
+
### Mode par défaut (tout injecter)
|
|
10
|
+
```bash
|
|
11
|
+
obsidian-inject ../my-plugin
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
### Mode interactif (choisir quoi injecter)
|
|
15
|
+
```bash
|
|
16
|
+
obsidian-inject ../my-plugin --interactive
|
|
17
|
+
# ou
|
|
18
|
+
obsidian-inject ../my-plugin -i
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Presets rapides
|
|
22
|
+
```bash
|
|
23
|
+
# Minimal : scripts + package.json + .env
|
|
24
|
+
obsidian-inject ../my-plugin --preset=minimal
|
|
25
|
+
|
|
26
|
+
# Scripts uniquement
|
|
27
|
+
obsidian-inject ../my-plugin --preset=scripts-only
|
|
28
|
+
|
|
29
|
+
# Config uniquement (tsconfig, eslint, prettier, etc.)
|
|
30
|
+
obsidian-inject ../my-plugin --preset=config-only
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Options Disponibles
|
|
34
|
+
|
|
35
|
+
Le mode interactif permet de choisir :
|
|
36
|
+
|
|
37
|
+
1. **scripts** - Scripts (esbuild.config.ts, acp.ts, utils.ts, etc.)
|
|
38
|
+
2. **packageJson** - package.json (scripts & dependencies)
|
|
39
|
+
3. **tsconfig** - tsconfig.json
|
|
40
|
+
4. **eslint** - eslint.config.mts
|
|
41
|
+
5. **prettier** - .prettierrc & .prettierignore
|
|
42
|
+
6. **editorconfig** - .editorconfig
|
|
43
|
+
7. **vscode** - .vscode/ (settings.json, tasks.json, extensions.json)
|
|
44
|
+
8. **github** - .github/workflows/ (release workflow)
|
|
45
|
+
9. **gitignore** - .gitignore
|
|
46
|
+
10. **env** - .env (template)
|
|
47
|
+
|
|
48
|
+
## Presets
|
|
49
|
+
|
|
50
|
+
### minimal
|
|
51
|
+
- ✅ scripts
|
|
52
|
+
- ✅ packageJson
|
|
53
|
+
- ✅ env
|
|
54
|
+
- ❌ Tout le reste
|
|
55
|
+
|
|
56
|
+
### scripts-only
|
|
57
|
+
- ✅ scripts uniquement
|
|
58
|
+
- ❌ Tout le reste
|
|
59
|
+
|
|
60
|
+
### config-only
|
|
61
|
+
- ✅ tsconfig
|
|
62
|
+
- ✅ eslint
|
|
63
|
+
- ✅ prettier
|
|
64
|
+
- ✅ editorconfig
|
|
65
|
+
- ✅ vscode
|
|
66
|
+
- ✅ gitignore
|
|
67
|
+
- ❌ scripts, packageJson, github, env
|
|
68
|
+
|
|
69
|
+
## Exemple d'Utilisation
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
# Lancer en mode interactif
|
|
73
|
+
$ obsidian-inject ../my-plugin -i
|
|
74
|
+
|
|
75
|
+
🎯 Injection Options
|
|
76
|
+
Select what you want to inject (default: all)
|
|
77
|
+
|
|
78
|
+
Use default options (inject everything)? [Y/n]: n
|
|
79
|
+
|
|
80
|
+
📋 Select individual options:
|
|
81
|
+
|
|
82
|
+
Inject Scripts (esbuild.config.ts, acp.ts, utils.ts, etc.)? [Y/n]: y
|
|
83
|
+
Inject package.json (scripts & dependencies)? [Y/n]: y
|
|
84
|
+
Inject tsconfig.json? [Y/n]: n
|
|
85
|
+
Inject eslint.config.mts? [Y/n]: n
|
|
86
|
+
Inject .prettierrc & .prettierignore? [Y/n]: y
|
|
87
|
+
Inject .editorconfig? [Y/n]: y
|
|
88
|
+
Inject .vscode/ (settings.json, tasks.json, extensions.json)? [Y/n]: y
|
|
89
|
+
Inject .github/workflows/ (release workflow)? [Y/n]: n
|
|
90
|
+
Inject .gitignore? [Y/n]: y
|
|
91
|
+
Inject .env (template)? [Y/n]: y
|
|
92
|
+
|
|
93
|
+
📋 Selected options:
|
|
94
|
+
✅ Scripts (esbuild.config.ts, acp.ts, utils.ts, etc.)
|
|
95
|
+
✅ package.json (scripts & dependencies)
|
|
96
|
+
❌ tsconfig.json
|
|
97
|
+
❌ eslint.config.mts
|
|
98
|
+
✅ .prettierrc & .prettierignore
|
|
99
|
+
✅ .editorconfig
|
|
100
|
+
✅ .vscode/ (settings.json, tasks.json, extensions.json)
|
|
101
|
+
❌ .github/workflows/ (release workflow)
|
|
102
|
+
✅ .gitignore
|
|
103
|
+
✅ .env (template)
|
|
104
|
+
|
|
105
|
+
Proceed with these options? [Y/n]: y
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Fichiers Modifiés
|
|
109
|
+
|
|
110
|
+
1. **scripts/inject-options.ts** (nouveau) - Gestion des options
|
|
111
|
+
2. **scripts/inject-core.ts** - Ajout paramètre `options` aux fonctions
|
|
112
|
+
3. **scripts/inject-path.ts** - Ajout flags `--interactive` et `--preset`
|
|
113
|
+
|
|
114
|
+
## Cas d'Usage
|
|
115
|
+
|
|
116
|
+
### Ne pas écraser esbuild.config.ts existant
|
|
117
|
+
```bash
|
|
118
|
+
obsidian-inject ../my-plugin -i
|
|
119
|
+
# Répondre 'n' à "Inject Scripts"
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Injecter uniquement les configs
|
|
123
|
+
```bash
|
|
124
|
+
obsidian-inject ../my-plugin --preset=config-only
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Tout sauf GitHub workflows
|
|
128
|
+
```bash
|
|
129
|
+
obsidian-inject ../my-plugin -i
|
|
130
|
+
# Répondre 'n' uniquement à ".github/workflows/"
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Notes
|
|
134
|
+
|
|
135
|
+
- Le fichier `.npmrc` est toujours injecté (protection Yarn)
|
|
136
|
+
- En mode non-interactif, tout est injecté par défaut
|
|
137
|
+
- Les options peuvent être combinées : `--interactive --sass`
|
package/docs/LLM-GUIDE.md
CHANGED
|
@@ -1,91 +1,112 @@
|
|
|
1
1
|
# LLM Guide — obsidian-plugin-config
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## What this tool does
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
**obsidian-plugin-config** is a **pure injection tool** that copies scripts and configuration files into Obsidian plugins, making them 100% standalone.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
- `src/` — reusable code (modals, utils, helpers) that can be tested locally and exported via NPM
|
|
10
|
-
- `scripts/` — local build/dev scripts for this repo itself (includes `build-npm.ts` for NPM publishing)
|
|
11
|
-
- `package.json` (root) — configuration for this local plugin + NPM package
|
|
12
|
-
- `tsconfig.json` (root) — TypeScript config for this local plugin
|
|
13
|
-
- `eslint.config.mts` (root) — ESLint config for this local plugin
|
|
7
|
+
---
|
|
14
8
|
|
|
15
|
-
|
|
9
|
+
## Architecture
|
|
16
10
|
|
|
17
|
-
###
|
|
11
|
+
### templates/ — Source of truth
|
|
18
12
|
|
|
19
|
-
`templates/`
|
|
13
|
+
`templates/` contains everything that gets injected into target plugins:
|
|
20
14
|
|
|
21
|
-
- `templates/scripts/` — scripts
|
|
15
|
+
- `templates/scripts/` — scripts copied into `<target>/scripts/`
|
|
22
16
|
- `templates/package.json` — base deps/scripts merged into `<target>/package.json`
|
|
23
17
|
- `templates/package-sass.json` — additional deps merged when `--sass` flag is used
|
|
24
18
|
- `templates/tsconfig.json` — TypeScript config injected as `<target>/tsconfig.json`
|
|
25
19
|
- `templates/eslint.config.mts` — ESLint config injected into target
|
|
26
20
|
- `templates/.editorconfig`, `templates/.prettierrc`, etc. — config files injected into target
|
|
27
|
-
- `templates/
|
|
21
|
+
- `templates/.github/workflows/` — GitHub Actions workflows
|
|
28
22
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
---
|
|
23
|
+
### scripts/ — Injection logic
|
|
32
24
|
|
|
33
|
-
|
|
25
|
+
- `scripts/inject-core.ts` — main injection logic
|
|
26
|
+
- `scripts/inject-path.ts` — CLI entry point (parses flags)
|
|
27
|
+
- `scripts/inject-prompt.ts` — interactive injection
|
|
28
|
+
- `scripts/build-npm.ts` — NPM publish workflow
|
|
29
|
+
- `scripts/acp.ts`, `scripts/help.ts`, `scripts/update-version-config.ts`, `scripts/utils.ts` — utilities
|
|
34
30
|
|
|
35
|
-
|
|
36
|
-
|---|---|---|
|
|
37
|
-
| Purpose | Local dev + NPM exports | Source for injection |
|
|
38
|
-
| package.json | This repo's own config | Base for target plugins |
|
|
39
|
-
| tsconfig.json | This repo's TS config | Injected into targets |
|
|
40
|
-
| scripts/ | Local scripts (+ build-npm) | Copied into targets |
|
|
31
|
+
### bin/ — Global CLI
|
|
41
32
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
**Never read root `package.json` or `tsconfig.json` as a reference for what gets injected.**
|
|
33
|
+
- `bin/obsidian-inject.js` — global CLI entry point (generated by build-npm.ts)
|
|
45
34
|
|
|
46
35
|
---
|
|
47
36
|
|
|
48
37
|
## What injection does
|
|
49
38
|
|
|
39
|
+
### 1. Package.json merge
|
|
40
|
+
|
|
50
41
|
`inject-core.ts → updatePackageJson()` reads `templates/package.json` (and `templates/package-sass.json` if `--sass`) and merges into the target plugin's `package.json`:
|
|
42
|
+
|
|
51
43
|
- All `scripts` are overwritten with template values
|
|
52
44
|
- All `devDependencies` from template are added/updated
|
|
53
45
|
- `engines` and `type` are set from template
|
|
54
46
|
- Target plugin's own specific deps are preserved
|
|
55
47
|
|
|
48
|
+
### 2. File copying
|
|
49
|
+
|
|
56
50
|
`inject-core.ts → injectScripts()` copies files from `templates/` into the target:
|
|
51
|
+
|
|
57
52
|
- `templates/scripts/*` → `<target>/scripts/`
|
|
58
53
|
- `templates/tsconfig.json` → `<target>/tsconfig.json`
|
|
59
54
|
- `templates/eslint.config.mts` → `<target>/eslint.config.mts`
|
|
60
55
|
- `templates/.editorconfig`, `.prettierrc`, `.npmrc`, `.env` → `<target>/`
|
|
61
56
|
- `templates/.github/workflows/*` → `<target>/.github/workflows/`
|
|
57
|
+
- `templates/gitignore.template` → `<target>/.gitignore`
|
|
58
|
+
|
|
59
|
+
### 3. Traceability
|
|
60
|
+
|
|
61
|
+
Creates `.injection-info.json` in target with version and date.
|
|
62
62
|
|
|
63
63
|
---
|
|
64
64
|
|
|
65
|
-
##
|
|
65
|
+
## Template scripts
|
|
66
|
+
|
|
67
|
+
Scripts in `templates/scripts/` that get copied to target plugins:
|
|
68
|
+
|
|
69
|
+
- `esbuild.config.ts` — build configuration (handles SASS automatically)
|
|
70
|
+
- `acp.ts` — add, commit, push workflow
|
|
71
|
+
- `update-version.ts` — version bump utility
|
|
72
|
+
- `release.ts` — GitHub release automation
|
|
73
|
+
- `utils.ts` — shared utilities
|
|
74
|
+
- `help.ts` — help documentation
|
|
66
75
|
|
|
67
|
-
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## SASS support
|
|
68
79
|
|
|
69
|
-
|
|
70
|
-
- `templates/scripts/` has only what target plugins need: `esbuild.config.ts`, `acp.ts`, `update-version.ts`, `release.ts`, `utils.ts`, `help.ts`
|
|
80
|
+
When `--sass` flag is used:
|
|
71
81
|
|
|
72
|
-
|
|
82
|
+
1. `templates/package-sass.json` deps are merged into target's `package.json`
|
|
83
|
+
2. Adds `esbuild-sass-plugin` dependency
|
|
84
|
+
3. The injected `esbuild.config.ts` automatically detects `.scss` files and uses the plugin
|
|
73
85
|
|
|
74
86
|
---
|
|
75
87
|
|
|
76
88
|
## What NOT to do
|
|
77
89
|
|
|
78
|
-
- ❌ Do not add `obsidian-plugin-config` as a dependency in `templates/package.json` — injected plugins are standalone
|
|
79
|
-
- ❌ Do not use `../obsidian-plugin-config/scripts/...` paths anywhere — that was the old sibling-repo approach, fully removed
|
|
80
90
|
- ❌ Do not hardcode deps/scripts in `inject-core.ts` — they must come from `templates/package.json`
|
|
81
|
-
- ❌ Do not modify root
|
|
82
|
-
- ❌ Do not
|
|
91
|
+
- ❌ Do not modify root config files thinking it will affect injected plugins — always modify `templates/`
|
|
92
|
+
- ❌ Do not add `obsidian-plugin-config` as a dependency in `templates/package.json` — injected plugins are standalone
|
|
83
93
|
|
|
84
94
|
---
|
|
85
95
|
|
|
86
|
-
##
|
|
96
|
+
## Updating injected content
|
|
87
97
|
|
|
88
|
-
|
|
98
|
+
To change what gets injected:
|
|
99
|
+
|
|
100
|
+
1. Modify files in `templates/`
|
|
101
|
+
2. Test locally: `yarn inject-path ../test-plugin`
|
|
102
|
+
3. Publish: `yarn npm-publish`
|
|
103
|
+
4. Re-inject into existing plugins to update them
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## obsidian-typings paths
|
|
108
|
+
|
|
109
|
+
The correct paths for `obsidian-typings` in `templates/tsconfig.json`:
|
|
89
110
|
|
|
90
111
|
```json
|
|
91
112
|
"types": ["obsidian-typings"],
|
|
@@ -97,15 +118,4 @@ The correct paths for `obsidian-typings` in `tsconfig.json` (confirmed against i
|
|
|
97
118
|
}
|
|
98
119
|
```
|
|
99
120
|
|
|
100
|
-
These
|
|
101
|
-
|
|
102
|
-
---
|
|
103
|
-
|
|
104
|
-
## docs/ folder
|
|
105
|
-
|
|
106
|
-
- `docs/package-ex.json` — example of a real working injected plugin's `package.json` (reference only)
|
|
107
|
-
- `docs/tsconfig-ex.json` — example of a real working injected plugin's `tsconfig.json` (reference only)
|
|
108
|
-
- `docs/package-versions.json` — archive (reference only, source of truth is `templates/package.json`)
|
|
109
|
-
- `docs/package-versions-sass.json` — archive (reference only, source of truth is `templates/package-sass.json`)
|
|
110
|
-
- `docs/IMPROVEMENT-PLAN-FOR-LLM.md` — historical task list (may be outdated)
|
|
111
|
-
- `docs/LLM-GUIDE.md` — this file
|
|
121
|
+
These must stay in sync with the actual `obsidian-typings` package structure.
|
|
@@ -0,0 +1,43 @@
|
|
|
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.
|
|
@@ -0,0 +1,127 @@
|
|
|
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
|