obsidian-plugin-config 1.0.4 β†’ 1.0.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "obsidian-plugin-config",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "SystΓ¨me d'injection pour plugins Obsidian autonomes",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
package/scripts/help.ts CHANGED
@@ -1,46 +1,162 @@
1
1
  #!/usr/bin/env tsx
2
2
 
3
3
  console.log(`
4
- Obsidian Plugin Config - Command Reference
4
+ 🎯 Obsidian Plugin Config - Guide Complet
5
5
  SystΓ¨me d'injection pour plugins Obsidian autonomes
6
6
 
7
- STRATÉGIE NPM GLOBAL:
8
- npm install -g obsidian-plugin-config # Installation globale (une seule fois)
9
- obsidian-inject # Injection depuis n'importe oΓΉ
10
- obsidian-inject /chemin/vers/plugin # Injection par chemin
7
+ ═══════════════════════════════════════════════════════════════════
11
8
 
12
- INJECTION LOCALE (dΓ©veloppement):
13
- yarn inject-path <chemin> Injection par chemin depuis plugin-config
14
- yarn inject <chemin> Alias pour inject-path
9
+ πŸš€ UTILISATION RAPIDE (NPM Global)
15
10
 
16
- MIGRATION (dΓ©veloppement):
17
- yarn migrate, m <chemin> Migration plugin vers architecture centralisΓ©e
18
- yarn migrate --dry-run AperΓ§u des changements sans appliquer
11
+ Installation globale (une seule fois):
12
+ npm install -g obsidian-plugin-config
13
+
14
+ Injection dans un plugin:
15
+ cd mon-plugin && obsidian-inject
16
+ obsidian-inject ../autre-plugin
17
+ obsidian-inject "C:\\chemin\\vers\\plugin"
18
+
19
+ ═══════════════════════════════════════════════════════════════════
20
+
21
+ πŸ”§ DΓ‰VELOPPEMENT LOCAL
22
+
23
+ Structure recommandΓ©e:
24
+ mes-plugins/
25
+ β”œβ”€β”€ obsidian-plugin-config/ # Ce repo
26
+ β”œβ”€β”€ mon-plugin-1/
27
+ β”œβ”€β”€ mon-plugin-2/
28
+ └── test-sample-plugin/ # Pour tests
29
+
30
+ Installation:
31
+ git clone https://github.com/3C0D/obsidian-plugin-config
32
+ cd obsidian-plugin-config
33
+ yarn install
34
+
35
+ Test injection locale:
36
+ yarn inject ../mon-plugin --yes
37
+ yarn inject-prompt "../mon-plugin"
38
+
39
+ ═══════════════════════════════════════════════════════════════════
40
+
41
+ πŸ“¦ WORKFLOW COMPLET : Local β†’ NPM Package
42
+
43
+ Γ‰TAPE 1 - DΓ©veloppement Local:
44
+ cd obsidian-plugin-config
45
+ # Modifier scripts/ selon vos besoins
46
+ yarn inject ../test-plugin --yes
47
+
48
+ Γ‰TAPE 2 - Corrections Obligatoires:
49
+ # Corriger TOUS les imports dans scripts/
50
+ # Changer .ts β†’ .js dans les imports
51
+ # Exemple: "./utils.ts" β†’ "./utils.js"
52
+
53
+ Γ‰TAPE 3 - Build NPM:
54
+ yarn build-npm # Corrige automatiquement
55
+ yarn update-version # Choisir p/min/maj
56
+
57
+ Γ‰TAPE 4 - Test Local Package:
58
+ npm pack
59
+ npm install -g ./obsidian-plugin-config-X.X.X.tgz
60
+ obsidian-inject ../test-plugin # Tester commande globale
61
+
62
+ Γ‰TAPE 5 - Publication NPM:
63
+ npm login # OBLIGATOIRE !
64
+ npm publish # Après connexion réussie
65
+
66
+ ═══════════════════════════════════════════════════════════════════
67
+
68
+ πŸ”‘ CONNEXION NPM - Points Critiques
69
+
70
+ PRÉREQUIS OBLIGATOIRES:
71
+ βœ… Compte NPM sur https://www.npmjs.com
72
+ βœ… Email vΓ©rifiΓ©
73
+ βœ… 2FA activΓ© (obligatoire pour publier)
74
+ βœ… Nom de package disponible
75
+
76
+ RΓ‰SOLUTION PROBLÈMES:
77
+ npm logout
78
+ npm login --registry https://registry.npmjs.org/
79
+ npm whoami # VΓ©rifier connexion
80
+ npm profile enable-2fa auth-and-writes
81
+
82
+ CONTOURNEMENTS TESTÉS:
83
+ βœ… DΓ©veloppement local : Fonctionne sans connexion
84
+ βœ… Test npm pack : Fonctionne sans connexion
85
+ ❌ Publication : Connexion NPM OBLIGATOIRE (pas de contournement)
86
+
87
+ ═══════════════════════════════════════════════════════════════════
88
+
89
+ πŸ”„ WORKFLOW MISE Γ€ JOUR
90
+
91
+ Pour futures modifications:
92
+ 1. cd obsidian-plugin-config
93
+ 2. Modifier scripts/...
94
+ 3. yarn inject ../test-plugin --yes
95
+ 4. Corriger imports (.ts β†’ .js)
96
+ 5. yarn build-npm
97
+ 6. yarn update-version
98
+ 7. npm pack && npm install -g ./package.tgz
99
+ 8. npm publish
100
+
101
+ ═══════════════════════════════════════════════════════════════════
102
+
103
+ πŸ—οΈ ADAPTATION PERSONNALISΓ‰E
104
+
105
+ Pour crΓ©er votre propre version:
106
+ 1. git clone https://github.com/3C0D/obsidian-plugin-config
107
+ 2. Modifier package.json (nom, version, etc.)
108
+ 3. Adapter scripts/ selon vos besoins
109
+ 4. Adapter templates/ (configurations par dΓ©faut)
110
+ 5. Tester: yarn inject ../votre-plugin --yes
111
+ 6. Publier votre package: npm publish
112
+
113
+ ═══════════════════════════════════════════════════════════════════
114
+
115
+ πŸ“‹ COMMANDES DISPONIBLES
116
+
117
+ INJECTION:
118
+ yarn inject <chemin> --yes # Injection automatique
119
+ yarn inject-prompt <chemin> # Injection avec prompts
19
120
 
20
121
  MAINTENANCE:
21
- yarn acp Add, commit, and push changes
22
- yarn update-version, v Update version
23
- yarn help, h Afficher cette aide
122
+ yarn acp # Add, commit, push
123
+ yarn update-version, v # Mise Γ  jour version
124
+ yarn build-npm # Build package NPM
125
+ yarn help, h # Cette aide
24
126
 
25
- EXEMPLES D'UTILISATION:
26
- # Installation globale (recommandΓ©e)
27
- npm install -g obsidian-plugin-config
28
- cd mon-plugin && obsidian-inject
127
+ ═══════════════════════════════════════════════════════════════════
128
+
129
+ βœ… CE QUI EST INJECTΓ‰
130
+
131
+ Scripts locaux autonomes:
132
+ βœ… esbuild.config.ts (build production/dev)
133
+ βœ… acp.ts (add-commit-push)
134
+ βœ… update-version.ts (gestion versions)
135
+ βœ… release.ts (releases GitHub)
136
+ βœ… help.ts (aide locale)
137
+ βœ… utils.ts (utilitaires partagΓ©s)
138
+
139
+ Configuration:
140
+ βœ… package.json (scripts, dΓ©pendances, protection yarn)
141
+ βœ… tsconfig.json (configuration TypeScript optimisΓ©e)
142
+ βœ… Installation automatique dΓ©pendances
143
+
144
+ RΓ©sultat:
145
+ βœ… Plugin 100% AUTONOME
146
+ βœ… Aucune dΓ©pendance externe
147
+ βœ… Mise Γ  jour via re-injection
148
+ βœ… Compatible tous plugins Obsidian
29
149
 
30
- # DΓ©veloppement local
31
- yarn inject-path "../mon-plugin"
32
- yarn inject "C:\\Users\\dev\\plugins\\mon-plugin"
150
+ ═══════════════════════════════════════════════════════════════════
33
151
 
34
- CE QUI EST INJECTÉ:
35
- βœ… Scripts locaux (esbuild.config.ts, acp.ts, utils.ts, etc.)
36
- βœ… Configuration package.json (scripts, dΓ©pendances)
37
- βœ… Protection yarn obligatoire
38
- βœ… Installation automatique des dΓ©pendances
152
+ ⚠️ POINTS IMPORTANTS
39
153
 
40
- ARCHITECTURE:
41
- - Plugin devient AUTONOME avec scripts locaux
42
- - Aucune dépendance externe requise après injection
43
- - Mise Γ  jour possible via re-injection
154
+ - Toujours tester localement avant publication NPM
155
+ - Corriger les extensions .ts β†’ .js dans les imports
156
+ - Connexion NPM obligatoire pour publier
157
+ - Sauvegarder vos modifications avant re-injection
158
+ - Utiliser yarn (protection intΓ©grΓ©e)
44
159
 
45
160
  COMPTE NPM: 3c0d (connectΓ©)
161
+ VERSION: 1.0.4
46
162
  `);
@@ -286,6 +286,9 @@ async function updatePackageJson(targetPath: string): Promise<void> {
286
286
  packageJson.engines.npm = "please-use-yarn";
287
287
  packageJson.engines.yarn = ">=1.22.0";
288
288
 
289
+ // Ensure ESM module type for modern configuration
290
+ packageJson.type = "module";
291
+
289
292
  // Write updated package.json
290
293
  fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2), 'utf8');
291
294
  console.log(` βœ… Updated package.json (${addedDeps} new, ${updatedDeps} updated dependencies)`);
@@ -249,6 +249,9 @@ async function updatePackageJson(targetPath: string): Promise<void> {
249
249
  packageJson.engines.npm = "please-use-yarn";
250
250
  packageJson.engines.yarn = ">=1.22.0";
251
251
 
252
+ // Ensure ESM module type for modern configuration
253
+ packageJson.type = "module";
254
+
252
255
  // Write updated package.json
253
256
  fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2), 'utf8');
254
257
  console.log(` βœ… Updated package.json (${addedDeps} new, ${updatedDeps} updated dependencies)`);
package/versions.json CHANGED
@@ -3,5 +3,6 @@
3
3
  "1.0.1": "1.8.9",
4
4
  "1.0.2": "1.8.9",
5
5
  "1.0.3": "1.8.9",
6
- "1.0.4": "1.8.9"
6
+ "1.0.4": "1.8.9",
7
+ "1.0.5": "1.8.9"
7
8
  }
@@ -1,18 +0,0 @@
1
- import { execSync } from 'child_process';
2
- import { platform } from 'os';
3
-
4
- const isWindows = platform() === 'win32';
5
-
6
- console.log(`Starting the ${process.env.npm_lifecycle_event} process...\n`);
7
- console.log('- Dependencies installed');
8
-
9
- try {
10
- if (isWindows) {
11
- execSync("start /B code .", { stdio: "ignore", shell: true });
12
- } else {
13
- execSync("code .", { stdio: "ignore" });
14
- }
15
- console.log('- Opened current folder in VSCode');
16
- } catch (error) {
17
- console.warn('Warning: Could not open VSCode');
18
- }